]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/dccp.h
[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9)
[linux-2.6-omap-h63xx.git] / include / linux / dccp.h
index add4908b8e577b78c8bc6151eefad7092992f9ce..007c290f74d4557b38161fe1ef9378fc4919f0bb 100644 (file)
@@ -4,10 +4,14 @@
 #include <linux/types.h>
 #include <asm/byteorder.h>
 
-/* FIXME: this is utterly wrong */
+/* Structure describing an Internet (DCCP) socket address. */
 struct sockaddr_dccp {
-       struct sockaddr_in      in;
-       unsigned int            service;
+       __u16   sdccp_family;   /* Address family   */
+       __u16   sdccp_port;     /* Port number      */
+       __u32   sdccp_addr;     /* Internet address */
+       __u32   sdccp_service;  /* Service          */
+       /* Pad to size of `struct sockaddr': 16 bytes . */
+       __u32   sdccp_pad;
 };
 
 /**
@@ -182,6 +186,9 @@ enum {
        DCCPF_MAX_CCID_SPECIFIC = 255,
 };
 
+/* DCCP socket options */
+#define DCCP_SOCKOPT_PACKET_SIZE       1
+
 #ifdef __KERNEL__
 
 #include <linux/in.h>
@@ -190,6 +197,7 @@ enum {
 #include <linux/workqueue.h>
 
 #include <net/inet_connection_sock.h>
+#include <net/inet_timewait_sock.h>
 #include <net/sock.h>
 #include <net/tcp_states.h>
 #include <net/tcp.h>
@@ -238,10 +246,15 @@ static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb)
        return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr));
 }
 
+static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh)
+{
+       return sizeof(*dh) + (dh->dccph_x ? sizeof(struct dccp_hdr_ext) : 0);
+}
+
 static inline unsigned int dccp_basic_hdr_len(const struct sk_buff *skb)
 {
        const struct dccp_hdr *dh = dccp_hdr(skb);
-       return sizeof(*dh) + (dh->dccph_x ? sizeof(struct dccp_hdr_ext) : 0);
+       return __dccp_basic_hdr_len(dh);
 }
 
 static inline __u64 dccp_hdr_seq(const struct sk_buff *skb)
@@ -293,10 +306,15 @@ static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb)
        return (struct dccp_hdr_reset *)(skb->h.raw + dccp_basic_hdr_len(skb));
 }
 
+static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh)
+{
+       return __dccp_basic_hdr_len(dh) +
+              dccp_packet_hdr_len(dh->dccph_type);
+}
+
 static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
 {
-       return dccp_basic_hdr_len(skb) +
-              dccp_packet_hdr_len(dccp_hdr(skb)->dccph_type);
+       return __dccp_hdr_len(dccp_hdr(skb));
 }
 
 
@@ -340,6 +358,8 @@ static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req)
        return (struct dccp_request_sock *)req;
 }
 
+extern struct inet_timewait_death_row dccp_death_row;
+
 /* Read about the ECN nonce to see why it is 253 */
 #define DCCP_MAX_ACK_VECTOR_LEN 253
 
@@ -379,7 +399,7 @@ enum dccp_role {
  * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option
  * @dccps_ext_header_len - network protocol overhead (IP/IPv6 options)
  * @dccps_pmtu_cookie - Last pmtu seen by socket
- * @dccps_avg_packet_size - FIXME: has to be set by the app thru some setsockopt or ioctl, CCID3 uses it
+ * @dccps_packet_size - Set thru setsockopt
  * @dccps_role - Role of this sock, one of %dccp_role
  * @dccps_ndp_count - number of Non Data Packets since last data packet
  * @dccps_hc_rx_ackpkts - receiver half connection acked packets
@@ -398,9 +418,9 @@ struct dccp_sock {
        __u64                           dccps_gsr;
        __u64                           dccps_gar;
        unsigned long                   dccps_service;
-       unsigned long                   dccps_timestamp_time;
+       struct timeval                  dccps_timestamp_time;
        __u32                           dccps_timestamp_echo;
-       __u32                           dccps_avg_packet_size;
+       __u32                           dccps_packet_size;
        unsigned long                   dccps_ndp_count;
        __u16                           dccps_ext_header_len;
        __u32                           dccps_pmtu_cookie;