Harald Welte | 9413503 | 2010-06-30 17:21:19 +0200 | [diff] [blame] | 1 | #ifndef _INT_SNDCP_H |
| 2 | #define _INT_SNDCP_H |
| 3 | |
| 4 | #include <stdint.h> |
Harald Welte | 8b1713a | 2011-03-23 18:26:56 +0100 | [diff] [blame] | 5 | #include <osmocom/core/linuxlist.h> |
Harald Welte | 9413503 | 2010-06-30 17:21:19 +0200 | [diff] [blame] | 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 | |
Pablo Neira Ayuso | 840ccf6 | 2011-05-06 12:11:06 +0200 | [diff] [blame] | 23 | struct osmo_timer_list timer; |
Harald Welte | 9413503 | 2010-06-30 17:21:19 +0200 | [diff] [blame] | 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 | |
Harald Welte | 3322cb3 | 2010-07-01 19:56:19 +0200 | [diff] [blame] | 36 | /* FIXME: move this RA_ID up to the LLME or even higher */ |
| 37 | struct gprs_ra_id ra_id; |
Harald Welte | 9413503 | 2010-06-30 17:21:19 +0200 | [diff] [blame] | 38 | /* reference to the LLC Entity below this SNDCP entity */ |
| 39 | struct gprs_llc_lle *lle; |
| 40 | /* The NSAPI we shall use on top of LLC */ |
| 41 | uint8_t nsapi; |
| 42 | |
| 43 | /* NPDU number for the GTP->SNDCP side */ |
| 44 | uint16_t tx_npdu_nr; |
| 45 | /* SNDCP eeceiver state */ |
| 46 | enum sndcp_rx_state rx_state; |
| 47 | /* The defragmentation queue */ |
| 48 | struct defrag_state defrag; |
| 49 | }; |
| 50 | |
| 51 | extern struct llist_head gprs_sndcp_entities; |
| 52 | |
| 53 | #endif /* INT_SNDCP_H */ |