Harald Welte | f78a3b2 | 2010-06-30 17:21:19 +0200 | [diff] [blame] | 1 | #ifndef _INT_SNDCP_H |
| 2 | #define _INT_SNDCP_H |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <osmocore/linuxlist.h> |
| 6 | |
| 7 | /* A fragment queue header, maintaining list of fragments for one N-PDU */ |
| 8 | struct defrag_state { |
| 9 | /* PDU number for which the defragmentation state applies */ |
| 10 | uint16_t npdu; |
| 11 | /* highest segment number we have received so far */ |
| 12 | uint8_t highest_seg; |
| 13 | /* bitmask of the segments we already have */ |
| 14 | uint32_t seg_have; |
| 15 | /* do we still expect more segments? */ |
| 16 | unsigned int no_more; |
| 17 | /* total length of all segments together */ |
| 18 | unsigned int tot_len; |
| 19 | |
| 20 | /* linked list of defrag_queue_entry: one for each fragment */ |
| 21 | struct llist_head frag_list; |
| 22 | |
| 23 | struct timer_list timer; |
| 24 | }; |
| 25 | |
| 26 | /* See 6.7.1.2 Reassembly */ |
| 27 | enum sndcp_rx_state { |
| 28 | SNDCP_RX_S_FIRST, |
| 29 | SNDCP_RX_S_SUBSEQ, |
| 30 | SNDCP_RX_S_DISCARD, |
| 31 | }; |
| 32 | |
| 33 | struct gprs_sndcp_entity { |
| 34 | struct llist_head list; |
| 35 | |
| 36 | /* reference to the LLC Entity below this SNDCP entity */ |
| 37 | struct gprs_llc_lle *lle; |
| 38 | /* The NSAPI we shall use on top of LLC */ |
| 39 | uint8_t nsapi; |
| 40 | |
| 41 | /* NPDU number for the GTP->SNDCP side */ |
| 42 | uint16_t tx_npdu_nr; |
| 43 | /* SNDCP eeceiver state */ |
| 44 | enum sndcp_rx_state rx_state; |
| 45 | /* The defragmentation queue */ |
| 46 | struct defrag_state defrag; |
| 47 | }; |
| 48 | |
| 49 | extern struct llist_head gprs_sndcp_entities; |
| 50 | |
| 51 | #endif /* INT_SNDCP_H */ |