blob: fef871aa12cf9248bf9c58ad4b26c2be1a050aee [file] [log] [blame]
Harald Weltef78a3b22010-06-30 17:21:19 +02001#ifndef _INT_SNDCP_H
2#define _INT_SNDCP_H
3
4#include <stdint.h>
Harald Welted36ff762011-03-23 18:26:56 +01005#include <osmocom/core/linuxlist.h>
Harald Weltef78a3b22010-06-30 17:21:19 +02006
7/* A fragment queue header, maintaining list of fragments for one N-PDU */
8struct 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 Ayusobf540cb2011-05-06 12:11:06 +020023 struct osmo_timer_list timer;
Harald Weltef78a3b22010-06-30 17:21:19 +020024};
25
26/* See 6.7.1.2 Reassembly */
27enum sndcp_rx_state {
28 SNDCP_RX_S_FIRST,
29 SNDCP_RX_S_SUBSEQ,
30 SNDCP_RX_S_DISCARD,
31};
32
33struct gprs_sndcp_entity {
34 struct llist_head list;
35
Harald Welte8911cef2010-07-01 19:56:19 +020036 /* FIXME: move this RA_ID up to the LLME or even higher */
37 struct gprs_ra_id ra_id;
Harald Weltef78a3b22010-06-30 17:21:19 +020038 /* 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
51extern struct llist_head gprs_sndcp_entities;
52
53#endif /* INT_SNDCP_H */