diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-17 00:44:57 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-17 00:44:57 +0200 |
commit | 2720e7310d3cce36bc3cbcf87d3e8eb2eecf5c75 (patch) | |
tree | 3136b5836493c1ad2841ef595a27042172cb7f26 /openbsc/src/gprs/gprs_sndcp.c | |
parent | 7363e92cd3b89eaa77db4bf502433524e16667b6 (diff) |
[GPRS] Initial untested support for libgtp
libgtp of the OpenGGSN project will allow us to speak the GTPv0/v1
protocol of the interface between SGSN and GGSN.
This commit includes code for the main libgtp integration (file
descriptor, select loop, timer) as well as code to encode/send
a CREATE PDP CONTEXT request.
Diffstat (limited to 'openbsc/src/gprs/gprs_sndcp.c')
-rw-r--r-- | openbsc/src/gprs/gprs_sndcp.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gprs_sndcp.c b/openbsc/src/gprs/gprs_sndcp.c index 0d1a39004..99a7638be 100644 --- a/openbsc/src/gprs/gprs_sndcp.c +++ b/openbsc/src/gprs/gprs_sndcp.c @@ -54,6 +54,9 @@ struct sndcp_udata_hdr { uint8_t npdu_low; }; +struct sndcp_entity { +}; + /* Entry point for the LL-UNITDATA.indication */ int sndcp_unitdata_ind(struct msgb *msg, uint8_t sapi, uint8_t *hdr, uint8_t len) { @@ -68,3 +71,59 @@ int sndcp_unitdata_ind(struct msgb *msg, uint8_t sapi, uint8_t *hdr, uint8_t len npdu = (suh->npdu_high << 8) | suh->npdu_low; } +/* Section 5.1.2.1 LL-RESET.ind */ +static int sndcp_ll_reset_ind(struct sndcp_entity *se,) +{ + /* treat all outstanding SNDCP-LLC request type primitives as not sent */ + /* reset all SNDCP XID parameters to default values */ +} + +/* Section 5.1.2.17 LL-UNITDATA.ind */ +static int sndcp_ll_unitdata_ind() +{ +} + +static int sndcp_ll_status_ind() +{ + /* inform the SM sub-layer by means of SNSM-STATUS.req */ +} + +static struct sndcp_state_list {{ + uint32_t states; + unsigned int type; + int (*rout)(struct sndcp_entity *se, struct msgb *msg); +} sndcp_state_list[] = { + { ALL_STATES, + LL_RESET_IND, sndcp_ll_reset_ind }, + { ALL_STATES, + LL_ESTABLISH_IND, sndcp_ll_est_ind }, + { SBIT(SNDCP_S_EST_RQD), + LL_ESTABLISH_RESP, sndcp_ll_est_ind }, + { SBIT(SNDCP_S_EST_RQD), + LL_ESTABLISH_CONF, sndcp_ll_est_conf }, + { SBIT(SNDCP_S_ +}; + +static int sndcp_rx_llc_prim() +{ + case LL_ESTABLISH_REQ: + case LL_RELEASE_REQ: + case LL_XID_REQ: + case LL_DATA_REQ: + LL_UNITDATA_REQ, /* TLLI, SN-PDU, Ref, QoS, Radio Prio, Ciph */ + + switch (prim) { + case LL_RESET_IND: + case LL_ESTABLISH_IND: + case LL_ESTABLISH_RESP: + case LL_ESTABLISH_CONF: + case LL_RELEASE_IND: + case LL_RELEASE_CONF: + case LL_XID_IND: + case LL_XID_RESP: + case LL_XID_CONF: + case LL_DATA_IND: + case LL_DATA_CONF: + case LL_UNITDATA_IND: + case LL_STATUS_IND: +} |