]> Pileus Git - ~andy/linux/blobdiff - net/dccp/ackvec.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
[~andy/linux] / net / dccp / ackvec.h
index 3f7008187b8eb34a1455d325111bcd3e2f8a8b42..e2ab0627a5ff6c2a63d35cf7641e6ac5dbbd5f4e 100644 (file)
@@ -29,6 +29,9 @@
 /* Estimated minimum average Ack Vector length - used for updating MPS */
 #define DCCPAV_MIN_OPTLEN      16
 
+/* Threshold for coping with large bursts of losses */
+#define DCCPAV_BURST_THRESH    (DCCPAV_MAX_ACKVEC_LEN / 8)
+
 enum dccp_ackvec_states {
        DCCPAV_RECEIVED =       0x00,
        DCCPAV_ECN_MARKED =     0x40,
@@ -61,7 +64,6 @@ static inline u8 dccp_ackvec_state(const u8 *cell)
  *                %DCCP_SINGLE_OPT_MAXLEN cells in the live portion of @av_buf
  * @av_overflow:   if 1 then buf_head == buf_tail indicates buffer wraparound
  * @av_records:           list of %dccp_ackvec_record (Ack Vectors sent previously)
- * @av_veclen:    length of the live portion of @av_buf
  */
 struct dccp_ackvec {
        u8                      av_buf[DCCPAV_MAX_ACKVEC_LEN];
@@ -72,7 +74,6 @@ struct dccp_ackvec {
        bool                    av_buf_nonce[DCCPAV_NUM_ACKVECS];
        u8                      av_overflow:1;
        struct list_head        av_records;
-       u16                     av_vec_len;
 };
 
 /** struct dccp_ackvec_record - Records information about sent Ack Vectors
@@ -98,24 +99,13 @@ struct dccp_ackvec_record {
        u8               avr_ack_nonce:1;
 };
 
-struct sock;
-struct sk_buff;
-
 extern int dccp_ackvec_init(void);
 extern void dccp_ackvec_exit(void);
 
 extern struct dccp_ackvec *dccp_ackvec_alloc(const gfp_t priority);
 extern void dccp_ackvec_free(struct dccp_ackvec *av);
 
-extern int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk,
-                          const u64 ackno, const u8 state);
-
-extern void dccp_ackvec_check_rcv_ackno(struct dccp_ackvec *av,
-                                       struct sock *sk, const u64 ackno);
-extern int dccp_ackvec_parse(struct sock *sk, const struct sk_buff *skb,
-                            u64 *ackno, const u8 opt,
-                            const u8 *value, const u8 len);
-
+extern void dccp_ackvec_input(struct dccp_ackvec *av, struct sk_buff *skb);
 extern int  dccp_ackvec_update_records(struct dccp_ackvec *av, u64 seq, u8 sum);
 extern void dccp_ackvec_clear_state(struct dccp_ackvec *av, const u64 ackno);
 extern u16  dccp_ackvec_buflen(const struct dccp_ackvec *av);
@@ -124,4 +114,23 @@ static inline bool dccp_ackvec_is_empty(const struct dccp_ackvec *av)
 {
        return av->av_overflow == 0 && av->av_buf_head == av->av_buf_tail;
 }
+
+/**
+ * struct dccp_ackvec_parsed  -  Record offsets of Ack Vectors in skb
+ * @vec:       start of vector (offset into skb)
+ * @len:       length of @vec
+ * @nonce:     whether @vec had an ECN nonce of 0 or 1
+ * @node:      FIFO - arranged in descending order of ack_ackno
+ * This structure is used by CCIDs to access Ack Vectors in a received skb.
+ */
+struct dccp_ackvec_parsed {
+       u8               *vec,
+                        len,
+                        nonce:1;
+       struct list_head node;
+};
+
+extern int dccp_ackvec_parsed_add(struct list_head *head,
+                                 u8 *vec, u8 len, u8 nonce);
+extern void dccp_ackvec_parsed_cleanup(struct list_head *parsed_chunks);
 #endif /* _ACKVEC_H */