pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/32312 )
Change subject: sndcp: Test MS vs NET paths separately and implement missing prims for MS ......................................................................
sndcp: Test MS vs NET paths separately and implement missing prims for MS
Related: OS#5502 Change-Id: Iebce37a50917b13c23de1528469d66c310ced7f2 --- M include/osmocom/gprs/sndcp/sndcp.h M include/osmocom/gprs/sndcp/sndcp_private.h M src/sndcp/sndcp.c M src/sndcp/sndcp_prim.c M tests/sndcp/slhc_test.c M tests/sndcp/sndcp_prim_test.c M tests/sndcp/sndcp_prim_test.err M tests/sndcp/sndcp_prim_test.ok M tests/sndcp/sndcp_xid_test.c 9 files changed, 395 insertions(+), 150 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/12/32312/1
diff --git a/include/osmocom/gprs/sndcp/sndcp.h b/include/osmocom/gprs/sndcp/sndcp.h index d9492a3..8acf93f 100644 --- a/include/osmocom/gprs/sndcp/sndcp.h +++ b/include/osmocom/gprs/sndcp/sndcp.h @@ -5,7 +5,13 @@ #include <stdint.h> #include <stddef.h>
-int osmo_gprs_sndcp_init(void); +enum osmo_gprs_sndcp_location { + OSMO_GPRS_SNDCP_LOCATION_UNSET, + OSMO_GPRS_SNDCP_LOCATION_MS, + OSMO_GPRS_SNDCP_LOCATION_NET, +}; + +int osmo_gprs_sndcp_init(enum osmo_gprs_sndcp_location location);
enum osmo_gprs_sndcp_log_cat { OSMO_GPRS_SNDCP_LOGC_SNDCP, diff --git a/include/osmocom/gprs/sndcp/sndcp_private.h b/include/osmocom/gprs/sndcp/sndcp_private.h index 6f4da3b..dcbde67 100644 --- a/include/osmocom/gprs/sndcp/sndcp_private.h +++ b/include/osmocom/gprs/sndcp/sndcp_private.h @@ -83,6 +83,7 @@ };
struct gprs_sndcp_ctx { + enum osmo_gprs_sndcp_location location; osmo_gprs_sndcp_prim_up_cb sndcp_up_cb; void *sndcp_up_cb_user_data;
@@ -157,6 +158,10 @@ /* The defragmentation queue */ struct gprs_sndcp_defrag_state defrag;
+ /* Whether we have an XID Request in transit which was originated by upper layers (TS 24.007 C.6): */ + bool xid_req_in_transit_orig_snsm_activate_ind; /* origin = SNSM-ACTIVATE.ind */ + bool xid_req_in_transit_orig_sn_xid_req; /* origin = SN-XID.req */ + /* Copy of the XID fields array we have sent with the last * originated XID-Request. NULL if not existing (and l3xid_req_len = 0) */ uint8_t *l3xid_req; @@ -196,16 +201,22 @@ /* sndcp_prim.c: */ struct osmo_gprs_sndcp_prim *gprs_sndcp_prim_alloc_sn_unitdata_ind(uint32_t tlli, uint8_t sapi, uint8_t nsapi, uint8_t *npdu, size_t npdu_len); struct osmo_gprs_sndcp_prim *gprs_sndcp_prim_alloc_sn_xid_ind(uint32_t tlli, uint8_t sapi, uint8_t nsapi); +struct osmo_gprs_sndcp_prim *gprs_sndcp_prim_alloc_sn_xid_cnf(uint32_t tlli, uint8_t sapi, uint8_t nsapi); struct osmo_gprs_sndcp_prim *gprs_sndcp_prim_alloc_snsm_activate_rsp(uint32_t tlli, uint8_t nsapi); int gprs_sndcp_prim_call_up_cb(struct osmo_gprs_sndcp_prim *sndcp_prim); int gprs_sndcp_prim_call_down_cb(struct osmo_gprs_llc_prim *llc_prim); +int gprs_sndcp_prim_call_snsm_cb(struct osmo_gprs_sndcp_prim *sndcp_prim);
/* sndcp.c: */ struct gprs_sndcp_mgmt_entity *gprs_sndcp_snme_alloc(uint32_t tlli); struct gprs_sndcp_mgmt_entity *gprs_sndcp_snme_find_by_tlli(uint32_t tlli); struct gprs_sndcp_entity *gprs_sndcp_sne_alloc(struct gprs_sndcp_mgmt_entity *snme, uint8_t llc_sapi, uint8_t nsapi); void gprs_sndcp_sne_free(struct gprs_sndcp_entity *sne); +struct gprs_sndcp_entity *gprs_sndcp_sne_by_dlci(uint32_t tlli, uint8_t llc_sapi); struct gprs_sndcp_entity *gprs_sndcp_sne_by_dlci_nsapi(uint32_t tlli, uint8_t llc_sapi, uint8_t nsapi); +int gprs_sndcp_sne_submit_llc_ll_establish_req(struct gprs_sndcp_entity *sne); +int gprs_sndcp_sne_submit_llc_ll_xid_req(struct gprs_sndcp_entity *sne); +int gprs_sndcp_sne_submit_snsm_activate_rsp(struct gprs_sndcp_entity *sne); int gprs_sndcp_sne_handle_llc_ll_unitdata_ind(struct gprs_sndcp_entity *sne, struct sndcp_common_hdr *sch, uint16_t len); int gprs_sndcp_snme_handle_llc_ll_xid_ind(struct gprs_sndcp_mgmt_entity *snme, uint32_t sapi, uint8_t *l3params, unsigned int l3params_len); diff --git a/src/sndcp/sndcp.c b/src/sndcp/sndcp.c index 6041ecd..4b54be3 100644 --- a/src/sndcp/sndcp.c +++ b/src/sndcp/sndcp.c @@ -34,12 +34,13 @@
struct gprs_sndcp_ctx *g_sndcp_ctx;
-int osmo_gprs_sndcp_init(void) +int osmo_gprs_sndcp_init(enum osmo_gprs_sndcp_location location) { if (g_sndcp_ctx) talloc_free(g_sndcp_ctx);
g_sndcp_ctx = talloc_zero(NULL, struct gprs_sndcp_ctx); + g_sndcp_ctx->location = location; INIT_LLIST_HEAD(&g_sndcp_ctx->snme_list); return 0; } @@ -142,6 +143,27 @@ talloc_free(sne); }
+struct gprs_sndcp_entity *gprs_sndcp_sne_by_dlci(uint32_t tlli, uint8_t llc_sapi) +{ + struct gprs_sndcp_mgmt_entity *snme = gprs_sndcp_snme_find_by_tlli(tlli); + struct gprs_sndcp_entity *sne; + unsigned int i; + + if (!snme) + return NULL; + + for (i = 0; i < ARRAY_SIZE(snme->sne); i++) { + sne = snme->sne[i]; + if (!sne) + continue; + if (sne->llc_sapi != llc_sapi) + continue; + return sne; + } + + return NULL; +} + struct gprs_sndcp_entity *gprs_sndcp_sne_by_dlci_nsapi(uint32_t tlli, uint8_t llc_sapi, uint8_t nsapi) { struct gprs_sndcp_mgmt_entity *snme = gprs_sndcp_snme_find_by_tlli(tlli); @@ -156,6 +178,52 @@ return sne; }
+int gprs_sndcp_sne_submit_llc_ll_establish_req(struct gprs_sndcp_entity *sne) +{ + struct osmo_gprs_llc_prim *llc_prim_tx; + int rc; + + llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_establish_req(sne->snme->tlli, sne->llc_sapi, + sne->l3xid_req, sne->l3xid_req_len); + OSMO_ASSERT(llc_prim_tx); + rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + return rc; +} + +int gprs_sndcp_sne_submit_llc_ll_xid_req(struct gprs_sndcp_entity *sne) +{ + struct osmo_gprs_llc_prim *llc_prim_tx; + int rc; + + llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_xid_req(sne->snme->tlli, sne->llc_sapi, + sne->l3xid_req, sne->l3xid_req_len); + OSMO_ASSERT(llc_prim_tx); + rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + return rc; +} + +int gprs_sndcp_sne_submit_sn_xid_cnf(struct gprs_sndcp_entity *sne) +{ + struct osmo_gprs_sndcp_prim *sndcp_prim_tx; + int rc; + + sndcp_prim_tx = gprs_sndcp_prim_alloc_sn_xid_cnf(sne->snme->tlli, sne->llc_sapi, sne->nsapi); + OSMO_ASSERT(sndcp_prim_tx); + rc = gprs_sndcp_prim_call_up_cb(sndcp_prim_tx); + return rc; +} + +int gprs_sndcp_sne_submit_snsm_activate_rsp(struct gprs_sndcp_entity *sne) +{ + struct osmo_gprs_sndcp_prim *sndcp_prim_tx; + int rc; + + sndcp_prim_tx = gprs_sndcp_prim_alloc_snsm_activate_rsp(sne->snme->tlli, sne->nsapi); + OSMO_ASSERT(sndcp_prim_tx); + rc = gprs_sndcp_prim_call_snsm_cb(sndcp_prim_tx); + return rc; +} + /* Check if any compression parameters are set in the sgsn configuration */ static inline int any_pcomp_or_dcomp_active(const struct gprs_sndcp_ctx *sgsn) { @@ -695,7 +763,6 @@ { int rc; uint8_t l3params[1024]; - struct osmo_gprs_llc_prim *llc_prim_tx;
/* Wipe off all compression entities and their states to * get rid of possible leftovers from a previous session */ @@ -714,12 +781,9 @@ talloc_free(sne->l3xid_req); sne->l3xid_req = NULL; } + sne->xid_req_in_transit_orig_sn_xid_req = true;
- llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_xid_req(sne->snme->tlli, sne->llc_sapi, - sne->l3xid_req, sne->l3xid_req_len); - OSMO_ASSERT(llc_prim_tx); - rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); - + rc = gprs_sndcp_sne_submit_llc_ll_xid_req(sne); return rc; }
@@ -1020,8 +1084,6 @@ if (sne_i->llc_sapi != sapi) continue; LOGSNE(sne_i, LOGL_DEBUG, "LL-XID.cnf: Found SNE SAPI=%u\n", sapi); - if (!sne_i->l3xid_req || sne_i->l3xid_req_len == 0) - continue; sne = sne_i; break; } @@ -1030,38 +1092,56 @@ return -EINVAL; }
- /* Parse SNDCP-CID XID-Field */ - comp_fields_req = gprs_sndcp_parse_xid(NULL, sne, sne->l3xid_req, sne->l3xid_req_len, NULL); - if (!comp_fields_req) - return -EINVAL; + if (sne->l3xid_req && sne->l3xid_req_len > 0) { + /* Parse SNDCP-CID XID-Field */ + comp_fields_req = gprs_sndcp_parse_xid(NULL, sne, sne->l3xid_req, sne->l3xid_req_len, NULL); + if (!comp_fields_req) + return -EINVAL;
- /* Parse SNDCP-CID XID-Field */ - comp_fields_conf = gprs_sndcp_parse_xid(NULL, sne, l3params, l3params_len, comp_fields_req); - if (!comp_fields_conf) { - talloc_free(comp_fields_req); - return -EINVAL; - } - - LOGSNDCP(LOGL_DEBUG, "LL-XID.cnf response comp_fields:\n"); - gprs_sndcp_dump_comp_fields(comp_fields_conf, LOGL_DEBUG); - - /* Handle compression entities */ - llist_for_each_entry(comp_field, comp_fields_conf, list) { - compclass = gprs_sndcp_get_compression_class(comp_field); - if (compclass == SNDCP_XID_PROTOCOL_COMPRESSION) - rc = gprs_sndcp_snme_handle_pcomp_entities(snme, sapi, comp_field); - else if (compclass == SNDCP_XID_DATA_COMPRESSION) - rc = gprs_sndcp_snme_handle_dcomp_entities(snme, sapi, comp_field); - else { - gprs_sndcp_comp_delete(snme->comp.proto, comp_field->entity); - gprs_sndcp_comp_delete(snme->comp.data, comp_field->entity); - rc = 0; + /* Parse SNDCP-CID XID-Field */ + comp_fields_conf = gprs_sndcp_parse_xid(NULL, sne, l3params, l3params_len, comp_fields_req); + if (!comp_fields_conf) { + talloc_free(comp_fields_req); + return -EINVAL; } - if (rc < 0) - break; + + LOGSNDCP(LOGL_DEBUG, "LL-XID.cnf response comp_fields:\n"); + gprs_sndcp_dump_comp_fields(comp_fields_conf, LOGL_DEBUG); + + /* Handle compression entities */ + llist_for_each_entry(comp_field, comp_fields_conf, list) { + compclass = gprs_sndcp_get_compression_class(comp_field); + if (compclass == SNDCP_XID_PROTOCOL_COMPRESSION) + rc = gprs_sndcp_snme_handle_pcomp_entities(snme, sapi, comp_field); + else if (compclass == SNDCP_XID_DATA_COMPRESSION) + rc = gprs_sndcp_snme_handle_dcomp_entities(snme, sapi, comp_field); + else { + gprs_sndcp_comp_delete(snme->comp.proto, comp_field->entity); + gprs_sndcp_comp_delete(snme->comp.data, comp_field->entity); + rc = 0; + } + if (rc < 0) + break; + } + + talloc_free(comp_fields_req); + talloc_free(comp_fields_conf); }
- talloc_free(comp_fields_req); - talloc_free(comp_fields_conf); + /* Originated by SNSM-ACTIVATE.ind: */ + if (sne->xid_req_in_transit_orig_snsm_activate_ind) { + sne->xid_req_in_transit_orig_snsm_activate_ind = false; + rc = gprs_sndcp_sne_submit_snsm_activate_rsp(sne); + } + /* Originated by SN-XID.req: */ + if (sne->xid_req_in_transit_orig_sn_xid_req) { + sne->xid_req_in_transit_orig_sn_xid_req = false; + rc = gprs_sndcp_sne_submit_sn_xid_cnf(sne); + } + + /* TODO: + * gprs_sndcp_prim_alloc_sn_xid_cnf() SN-XID-CNF if SN-XID-REQ pending + * gprs_sndcp_prim_alloc_snsm_activate_rsp() SNSM-ACTIVATE-RSP if SNSM-ACTIVATE-IND pending + */ return rc; } diff --git a/src/sndcp/sndcp_prim.c b/src/sndcp/sndcp_prim.c index bc22c9c..b9b5041 100644 --- a/src/sndcp/sndcp_prim.c +++ b/src/sndcp/sndcp_prim.c @@ -206,7 +206,7 @@ return sndcp_prim; }
-/* 5.1.1.5 SN-XID.indication */ +/* 5.1.1.6 SN-XID.indication */ struct osmo_gprs_sndcp_prim *gprs_sndcp_prim_alloc_sn_xid_ind(uint32_t tlli, uint8_t sapi, uint8_t nsapi) { struct osmo_gprs_sndcp_prim *sndcp_prim; @@ -228,6 +228,17 @@ return sndcp_prim; }
+/* 5.1.1.8 SN-XID.confirmation */ +struct osmo_gprs_sndcp_prim *gprs_sndcp_prim_alloc_sn_xid_cnf(uint32_t tlli, uint8_t sapi, uint8_t nsapi) +{ + struct osmo_gprs_sndcp_prim *sndcp_prim; + sndcp_prim = sndcp_prim_sn_alloc(OSMO_GPRS_SNDCP_SN_XID, PRIM_OP_CONFIRM, 0); + sndcp_prim->sn.tlli = tlli; + sndcp_prim->sn.sapi = sapi; + sndcp_prim->sn.xid_ind.nsapi = nsapi; + return sndcp_prim; +} + /*** SN SM ***/
static inline struct osmo_gprs_sndcp_prim *sndcp_prim_snsm_alloc(enum osmo_gprs_sndcp_snsm_prim_type type, @@ -456,6 +467,23 @@ return rc; }
+static int gprs_sndcp_prim_handle_llc_ll_establish_cnf(struct osmo_gprs_llc_prim *llc_prim) +{ + int rc; + struct gprs_sndcp_entity *sne; + + sne = gprs_sndcp_sne_by_dlci(llc_prim->ll.tlli, llc_prim->ll.sapi); + if (!sne) { + LOGSNDCP(LOGL_ERROR, "Message for non-existing SNDCP Entity " + "(TLLI=%08x, SAPI=%u)\n", + llc_prim->ll.tlli, llc_prim->ll.sapi); + return -EIO; + } + + rc = gprs_sndcp_sne_submit_snsm_activate_rsp(sne); + return rc; +} + static int gprs_sndcp_prim_handle_llc_ll_xid_ind(struct osmo_gprs_llc_prim *llc_prim) { int rc; @@ -500,6 +528,9 @@ case OSMO_PRIM(OSMO_GPRS_LLC_LL_UNITDATA, PRIM_OP_INDICATION): rc = gprs_sndcp_prim_handle_llc_ll_unitdata_ind(llc_prim); break; + case OSMO_PRIM(OSMO_GPRS_LLC_LL_ESTABLISH, PRIM_OP_CONFIRM): + rc = gprs_sndcp_prim_handle_llc_ll_establish_cnf(llc_prim); + break; case OSMO_PRIM(OSMO_GPRS_LLC_LL_XID, PRIM_OP_INDICATION): rc = gprs_sndcp_prim_handle_llc_ll_xid_ind(llc_prim); break; @@ -528,6 +559,7 @@ break; default: rc = gprs_sndcp_prim_handle_llc_ll_unsupported(llc_prim); + rc = 1; }
/* Special return value '1' means: do not free */ @@ -561,6 +593,7 @@ uint8_t sapi = sndcp_prim->snsm.activate_ind.sapi; uint8_t nsapi = sndcp_prim->snsm.activate_ind.nsapi; struct gprs_sndcp_mgmt_entity *snme; + struct gprs_sndcp_entity *sne;
LOGSNDCP(LOGL_INFO, "SNSM-ACTIVATE.ind (TLLI=%08x, SAPI=%u, NSAPI=%u)\n", tlli, sapi, nsapi); @@ -568,23 +601,36 @@ snme = gprs_sndcp_snme_find_by_tlli(tlli); if (!snme) { snme = gprs_sndcp_snme_alloc(tlli); - } else if (gprs_sndcp_snme_get_sne(snme, nsapi)) { - LOGSNDCP(LOGL_ERROR, "Trying to ACTIVATE already-existing entity " - "(TLLI=%08x, SAPI=%u, NSAPI=%u)\n", - tlli, sapi, nsapi); - return -EEXIST; + if (!snme) { + LOGSNDCP(LOGL_ERROR, "Out of memory during ACTIVATE\n"); + return -ENOMEM; + } }
- if (!snme) { - LOGSNDCP(LOGL_ERROR, "Out of memory during ACTIVATE\n"); - return -ENOMEM; + if (!(sne = gprs_sndcp_snme_get_sne(snme, nsapi))) { + sne = gprs_sndcp_sne_alloc(snme, sapi, nsapi); + if (!sne) { + LOGSNME(snme, LOGL_ERROR, "Out of memory during ACTIVATE\n"); + return -ENOMEM; + } }
- if (!gprs_sndcp_sne_alloc(snme, sapi, nsapi)) { - LOGSNDCP(LOGL_ERROR, "Out of memory during ACTIVATE\n"); - return -ENOMEM; - } + /* Nothing to do below if we are not MS. In NET mode, we wait for + * LL-ESTABLISH-IND or LL-XID-IND. */ + if (g_sndcp_ctx->location != OSMO_GPRS_SNDCP_LOCATION_MS) + return 0;
+ /* TODO: when supporting and using LLC ABM mode, flow should go through + * LL-ESTABLISH.req, as per TS 24.007 C.6 "No LLC link exists yet, + * establish a link and exchange XID" + * + * rc = gprs_sndcp_sne_submit_llc_ll_establish_req(sne); + * return rc; + */ + + /* TS 24.007 C.6 "LLC link exists already, only XID exchange" */ + sne->xid_req_in_transit_orig_snsm_activate_ind = true; + rc = gprs_sndcp_sne_submit_llc_ll_xid_req(sne); return rc; }
diff --git a/tests/sndcp/slhc_test.c b/tests/sndcp/slhc_test.c index fdebb5b..31126ad 100644 --- a/tests/sndcp/slhc_test.c +++ b/tests/sndcp/slhc_test.c @@ -262,7 +262,7 @@ log_ctx = talloc_named_const(ctx, 0, "log"); osmo_init_logging2(log_ctx, &info);
- rc = osmo_gprs_sndcp_init(); + rc = osmo_gprs_sndcp_init(OSMO_GPRS_SNDCP_LOCATION_MS); OSMO_ASSERT(rc == 0); osmo_gprs_sndcp_set_log_cat(OSMO_GPRS_SNDCP_LOGC_SNDCP, DSNDCP); osmo_gprs_sndcp_set_log_cat(OSMO_GPRS_SNDCP_LOGC_SLHC, DSLHC); diff --git a/tests/sndcp/sndcp_prim_test.c b/tests/sndcp/sndcp_prim_test.c index b1f29ef..cf29ec0 100644 --- a/tests/sndcp/sndcp_prim_test.c +++ b/tests/sndcp/sndcp_prim_test.c @@ -93,7 +93,15 @@ OSMO_ASSERT(0); }
- printf("%s(): Rx %s\n", __func__, npdu_name); + switch (OSMO_PRIM_HDR(&sndcp_prim->oph)) { + case OSMO_PRIM(OSMO_GPRS_SNDCP_SNSM_ACTIVATE, PRIM_OP_RESPONSE): + printf("%s(): Rx %s\n", __func__, npdu_name); + break; + default: + printf("%s(): Unexpected Rx %s\n", __func__, npdu_name); + OSMO_ASSERT(0); + } + return 0; }
@@ -113,7 +121,7 @@ 0x01, 0x05, 0x00, 0x06, 0x00, 0x07, 0x01, 0x07, 0x00, 0x08, 0x01, 0x08, 0x80, 0x00, 0x04, 0x12, 0x00, 0x40, 0x07 };
-static void test_sndcp_prim(void) +static void test_sndcp_prim_net(void) { struct osmo_gprs_sndcp_prim *sndcp_prim; struct osmo_gprs_llc_prim *llc_prim; @@ -124,32 +132,21 @@ int rc; printf("==== %s() [start] ====\n", __func__);
- rc = osmo_gprs_sndcp_init(); + rc = osmo_gprs_sndcp_init(OSMO_GPRS_SNDCP_LOCATION_NET); OSMO_ASSERT(rc == 0);
osmo_gprs_sndcp_prim_set_up_cb(test_sndcp_prim_up_cb, NULL); osmo_gprs_sndcp_prim_set_down_cb(test_sndcp_prim_down_cb, NULL); osmo_gprs_sndcp_prim_set_snsm_cb(test_sndcp_prim_snsm_cb, NULL);
- /* SNSM-ACTIVATE.Ind: */ + /* SNSM-ACTIVATE.Ind, internally submits LL-XID.Req (it would submit + * LL-ESTABLISH.Req in ABM mode if we supported it): */ sndcp_prim = osmo_gprs_sndcp_prim_alloc_snsm_activate_ind(tlli, nsapi, ll_sapi); OSMO_ASSERT(sndcp_prim); rc = osmo_gprs_sndcp_prim_dispatch_snsm(sndcp_prim); OSMO_ASSERT(rc == 0);
- /* Submit SN-XID.Req, triggers rx of LL-XID.Req: */ - sndcp_prim = osmo_gprs_sndcp_prim_alloc_sn_xid_req(tlli, ll_sapi, nsapi); - OSMO_ASSERT(sndcp_prim); - sndcp_prim->sn.xid_req.pcomp_rfc1144.active = true; - sndcp_prim->sn.xid_req.pcomp_rfc1144.s01 = 7; - rc = osmo_gprs_sndcp_prim_upper_down(sndcp_prim); - OSMO_ASSERT(rc == 0); - - /* Submit LL-XID.Cnf, triggers rx of LL-XID.cnf */ - llc_prim = gprs_llc_prim_alloc_ll_xid_cnf(tlli, ll_sapi, (uint8_t *)sndcp_xid, sizeof(sndcp_xid)); - OSMO_ASSERT(llc_prim); - rc = osmo_gprs_sndcp_prim_lower_up(llc_prim); - OSMO_ASSERT(rc == 0); + /* Id we supported and use ABM: Submit LL-ESTABLISH.Ind, triggers rx of LL-ESTABLISH.Rsp */
/* Submit LL-XID.Ind, triggers rx of SN-XID.Ind: */ llc_prim = gprs_llc_prim_alloc_ll_xid_ind(tlli, ll_sapi, (uint8_t *)sndcp_xid, sizeof(sndcp_xid)); @@ -177,7 +174,84 @@
/* TODO: SN-XID REQ / IND / RESP / CONF - * TODO: Other primitivbes coming from LLC layer + * TODO: Other primitives coming from LLC layer + */ + + /* SNSM-DEACTIVATE.Ind: */ + sndcp_prim = osmo_gprs_sndcp_prim_alloc_snsm_deactivate_ind(tlli, nsapi); + OSMO_ASSERT(sndcp_prim); + rc = osmo_gprs_sndcp_prim_dispatch_snsm(sndcp_prim); + OSMO_ASSERT(rc == 0); + + printf("==== %s() [end] ====\n", __func__); +} + +static void test_sndcp_prim_ms(void) +{ + struct osmo_gprs_sndcp_prim *sndcp_prim; + struct osmo_gprs_llc_prim *llc_prim; + const uint32_t tlli = 0xe1c5d364; + const enum osmo_gprs_llc_sapi ll_sapi = OSMO_GPRS_LLC_SAPI_SNDCP3; + const uint8_t nsapi = 0x05; + uint8_t sndcp_data[1024]; + int rc; + printf("==== %s() [start] ====\n", __func__); + + rc = osmo_gprs_sndcp_init(OSMO_GPRS_SNDCP_LOCATION_MS); + OSMO_ASSERT(rc == 0); + + osmo_gprs_sndcp_prim_set_up_cb(test_sndcp_prim_up_cb, NULL); + osmo_gprs_sndcp_prim_set_down_cb(test_sndcp_prim_down_cb, NULL); + osmo_gprs_sndcp_prim_set_snsm_cb(test_sndcp_prim_snsm_cb, NULL); + + /* SNSM-ACTIVATE.Ind, internally submits LL-XID.Req (it would submit + * LL-ESTABLISH.Req in ABM mode if we supported it): */ + sndcp_prim = osmo_gprs_sndcp_prim_alloc_snsm_activate_ind(tlli, nsapi, ll_sapi); + OSMO_ASSERT(sndcp_prim); + rc = osmo_gprs_sndcp_prim_dispatch_snsm(sndcp_prim); + OSMO_ASSERT(rc == 0); + + /* Id we supported and use ABM: Submit LL-ESTABLISH.Cnf, triggers rx of SNSM-ACTIVATE.Rsp */ + //llc_prim = gprs_llc_prim_alloc_ll_establish_cnf(tlli, ll_sapi, (uint8_t *)sndcp_xid, sizeof(sndcp_xid)); + //OSMO_ASSERT(llc_prim); + //rc = osmo_gprs_sndcp_prim_lower_up(llc_prim); + //OSMO_ASSERT(rc == 0); + + /* Network answers XID req, Submit LL-XID.Cnf, triggers rx of SNSM-ACTIVATE-RSP */ + llc_prim = gprs_llc_prim_alloc_ll_xid_cnf(tlli, ll_sapi, (uint8_t *)sndcp_xid, sizeof(sndcp_xid)); + OSMO_ASSERT(llc_prim); + rc = osmo_gprs_sndcp_prim_lower_up(llc_prim); + OSMO_ASSERT(rc == 0); + + /* Submit SN-XID.Req from upper layers, triggers rx of LL-XID.Req: */ + sndcp_prim = osmo_gprs_sndcp_prim_alloc_sn_xid_req(tlli, ll_sapi, nsapi); + OSMO_ASSERT(sndcp_prim); + sndcp_prim->sn.xid_req.pcomp_rfc1144.active = true; + sndcp_prim->sn.xid_req.pcomp_rfc1144.s01 = 7; + rc = osmo_gprs_sndcp_prim_upper_down(sndcp_prim); + OSMO_ASSERT(rc == 0); + + /* Submit LL-XID.Cnf, triggers rx of SN-XID.cnf */ + llc_prim = gprs_llc_prim_alloc_ll_xid_cnf(tlli, ll_sapi, (uint8_t *)sndcp_xid, sizeof(sndcp_xid)); + OSMO_ASSERT(llc_prim); + rc = osmo_gprs_sndcp_prim_lower_up(llc_prim); + OSMO_ASSERT(rc == 0); + + OSMO_ASSERT(osmo_hexparse(sndcp_data_hex, sndcp_data, sizeof(sndcp_data)) > 0); + llc_prim = gprs_llc_prim_alloc_ll_unitdata_ind(tlli, ll_sapi, (uint8_t *)sndcp_data, sizeof(sndcp_data)); + OSMO_ASSERT(llc_prim); + rc = osmo_gprs_sndcp_prim_lower_up(llc_prim); + OSMO_ASSERT(rc == 0); + + char ndpu_data[] = "some-npdu-data-like-an-ip-pkt"; + sndcp_prim = osmo_gprs_sndcp_prim_alloc_sn_unitdata_req(tlli, ll_sapi, nsapi, (uint8_t *)ndpu_data, sizeof(ndpu_data)); + OSMO_ASSERT(sndcp_prim); + rc = osmo_gprs_sndcp_prim_upper_down(sndcp_prim); + OSMO_ASSERT(rc == 0); + + + /* TODO: SN-XID REQ / IND / RESP / CONF + * TODO: Other primitives coming from LLC layer */
/* SNSM-DEACTIVATE.Ind: */ @@ -208,7 +282,8 @@ log_set_print_level(osmo_stderr_target, 1); log_set_use_color(osmo_stderr_target, 0);
- test_sndcp_prim(); + test_sndcp_prim_net(); + test_sndcp_prim_ms();
talloc_free(tall_ctx); } diff --git a/tests/sndcp/sndcp_prim_test.err b/tests/sndcp/sndcp_prim_test.err index f27486d..d61a18a 100644 --- a/tests/sndcp/sndcp_prim_test.err +++ b/tests/sndcp/sndcp_prim_test.err @@ -1,79 +1,5 @@ DLGLOBAL INFO Rx from SNDCP SM sublayer: SNSM-ACTIVATE.indication DLGLOBAL INFO SNSM-ACTIVATE.ind (TLLI=e1c5d364, SAPI=3, NSAPI=5) -DLGLOBAL INFO Rx from upper layers: SN-XID.request -DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) SN-XID.req comp_fields: -DLGLOBAL DEBUG SNDCP-XID: -DLGLOBAL DEBUG struct gprs_sndcp_comp_field { -DLGLOBAL DEBUG entity=0; -DLGLOBAL DEBUG algo=0; -DLGLOBAL DEBUG comp_len=2; -DLGLOBAL DEBUG comp[0]=1; -DLGLOBAL DEBUG comp[1]=2; -DLGLOBAL DEBUG gprs_sndcp_pcomp_rfc1144_params { -DLGLOBAL DEBUG nsapi_len=1; -DLGLOBAL DEBUG nsapi[0]=5; -DLGLOBAL DEBUG s01=7; -DLGLOBAL DEBUG } -DLGLOBAL DEBUG } -DLGLOBAL INFO Rx from lower layers: LL-XID.confirm -DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) LL-XID.cnf: Found SNE SAPI=3 -DLGLOBAL DEBUG LL-XID.cnf response comp_fields: -DLGLOBAL DEBUG SNDCP-XID: -DLGLOBAL DEBUG struct gprs_sndcp_comp_field { -DLGLOBAL DEBUG entity=0; -DLGLOBAL DEBUG algo=0; -DLGLOBAL DEBUG comp_len=2; -DLGLOBAL DEBUG comp[0]=1; -DLGLOBAL DEBUG comp[1]=2; -DLGLOBAL DEBUG gprs_sndcp_pcomp_rfc1144_params { -DLGLOBAL DEBUG nsapi_len=1; -DLGLOBAL DEBUG nsapi[0]=6; -DLGLOBAL DEBUG s01=7; -DLGLOBAL DEBUG } -DLGLOBAL DEBUG } -DLGLOBAL DEBUG SNDCP-XID: -DLGLOBAL DEBUG struct gprs_sndcp_comp_field { -DLGLOBAL DEBUG entity=2; -DLGLOBAL DEBUG algo=2; -DLGLOBAL DEBUG comp_len=2; -DLGLOBAL DEBUG comp[0]=8; -DLGLOBAL DEBUG comp[1]=9; -DLGLOBAL DEBUG gprs_sndcp_pcomp_rohc_params { -DLGLOBAL DEBUG nsapi_len=11; -DLGLOBAL DEBUG nsapi[0]=5; -DLGLOBAL DEBUG nsapi[1]=6; -DLGLOBAL DEBUG nsapi[2]=7; -DLGLOBAL DEBUG nsapi[3]=8; -DLGLOBAL DEBUG nsapi[4]=9; -DLGLOBAL DEBUG nsapi[5]=10; -DLGLOBAL DEBUG nsapi[6]=11; -DLGLOBAL DEBUG nsapi[7]=12; -DLGLOBAL DEBUG nsapi[8]=13; -DLGLOBAL DEBUG nsapi[9]=14; -DLGLOBAL DEBUG nsapi[10]=15; -DLGLOBAL DEBUG max_cid=15; -DLGLOBAL DEBUG max_header=168; -DLGLOBAL DEBUG profile_len=16; -DLGLOBAL DEBUG profile[0]=0000; -DLGLOBAL DEBUG profile[1]=0001; -DLGLOBAL DEBUG profile[2]=0101; -DLGLOBAL DEBUG profile[3]=0002; -DLGLOBAL DEBUG profile[4]=0102; -DLGLOBAL DEBUG profile[5]=0003; -DLGLOBAL DEBUG profile[6]=0103; -DLGLOBAL DEBUG profile[7]=0004; -DLGLOBAL DEBUG profile[8]=0104; -DLGLOBAL DEBUG profile[9]=0005; -DLGLOBAL DEBUG profile[10]=0105; -DLGLOBAL DEBUG profile[11]=0006; -DLGLOBAL DEBUG profile[12]=0007; -DLGLOBAL DEBUG profile[13]=0107; -DLGLOBAL DEBUG profile[14]=0008; -DLGLOBAL DEBUG profile[15]=0108; -DLGLOBAL DEBUG } -DLGLOBAL DEBUG } -DLGLOBAL DEBUG SNME(e1c5d364) Rejecting RFC1144 header compression... -DLGLOBAL DEBUG SNME(e1c5d364) Rejecting ROHC header compression... DLGLOBAL INFO Rx from lower layers: LL-XID.indication DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) LL-XID.ind: Found SNE SAPI=3 DLGLOBAL DEBUG SNME(e1c5d364) LL-XID.cnf requested comp_fields: @@ -185,3 +111,87 @@ DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) free() DLGLOBAL DEBUG SNME(e1c5d364) No SNDCP Entities left activate, freeing SNME DLGLOBAL DEBUG SNME(e1c5d364) free() +DLGLOBAL INFO Rx from SNDCP SM sublayer: SNSM-ACTIVATE.indication +DLGLOBAL INFO SNSM-ACTIVATE.ind (TLLI=e1c5d364, SAPI=3, NSAPI=5) +DLGLOBAL INFO Rx from lower layers: LL-XID.confirm +DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) LL-XID.cnf: Found SNE SAPI=3 +DLGLOBAL INFO Rx from upper layers: SN-XID.request +DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) SN-XID.req comp_fields: +DLGLOBAL DEBUG SNDCP-XID: +DLGLOBAL DEBUG struct gprs_sndcp_comp_field { +DLGLOBAL DEBUG entity=0; +DLGLOBAL DEBUG algo=0; +DLGLOBAL DEBUG comp_len=2; +DLGLOBAL DEBUG comp[0]=1; +DLGLOBAL DEBUG comp[1]=2; +DLGLOBAL DEBUG gprs_sndcp_pcomp_rfc1144_params { +DLGLOBAL DEBUG nsapi_len=1; +DLGLOBAL DEBUG nsapi[0]=5; +DLGLOBAL DEBUG s01=7; +DLGLOBAL DEBUG } +DLGLOBAL DEBUG } +DLGLOBAL INFO Rx from lower layers: LL-XID.confirm +DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) LL-XID.cnf: Found SNE SAPI=3 +DLGLOBAL DEBUG LL-XID.cnf response comp_fields: +DLGLOBAL DEBUG SNDCP-XID: +DLGLOBAL DEBUG struct gprs_sndcp_comp_field { +DLGLOBAL DEBUG entity=0; +DLGLOBAL DEBUG algo=0; +DLGLOBAL DEBUG comp_len=2; +DLGLOBAL DEBUG comp[0]=1; +DLGLOBAL DEBUG comp[1]=2; +DLGLOBAL DEBUG gprs_sndcp_pcomp_rfc1144_params { +DLGLOBAL DEBUG nsapi_len=1; +DLGLOBAL DEBUG nsapi[0]=6; +DLGLOBAL DEBUG s01=7; +DLGLOBAL DEBUG } +DLGLOBAL DEBUG } +DLGLOBAL DEBUG SNDCP-XID: +DLGLOBAL DEBUG struct gprs_sndcp_comp_field { +DLGLOBAL DEBUG entity=2; +DLGLOBAL DEBUG algo=2; +DLGLOBAL DEBUG comp_len=2; +DLGLOBAL DEBUG comp[0]=8; +DLGLOBAL DEBUG comp[1]=9; +DLGLOBAL DEBUG gprs_sndcp_pcomp_rohc_params { +DLGLOBAL DEBUG nsapi_len=11; +DLGLOBAL DEBUG nsapi[0]=5; +DLGLOBAL DEBUG nsapi[1]=6; +DLGLOBAL DEBUG nsapi[2]=7; +DLGLOBAL DEBUG nsapi[3]=8; +DLGLOBAL DEBUG nsapi[4]=9; +DLGLOBAL DEBUG nsapi[5]=10; +DLGLOBAL DEBUG nsapi[6]=11; +DLGLOBAL DEBUG nsapi[7]=12; +DLGLOBAL DEBUG nsapi[8]=13; +DLGLOBAL DEBUG nsapi[9]=14; +DLGLOBAL DEBUG nsapi[10]=15; +DLGLOBAL DEBUG max_cid=15; +DLGLOBAL DEBUG max_header=168; +DLGLOBAL DEBUG profile_len=16; +DLGLOBAL DEBUG profile[0]=0000; +DLGLOBAL DEBUG profile[1]=0001; +DLGLOBAL DEBUG profile[2]=0101; +DLGLOBAL DEBUG profile[3]=0002; +DLGLOBAL DEBUG profile[4]=0102; +DLGLOBAL DEBUG profile[5]=0003; +DLGLOBAL DEBUG profile[6]=0103; +DLGLOBAL DEBUG profile[7]=0004; +DLGLOBAL DEBUG profile[8]=0104; +DLGLOBAL DEBUG profile[9]=0005; +DLGLOBAL DEBUG profile[10]=0105; +DLGLOBAL DEBUG profile[11]=0006; +DLGLOBAL DEBUG profile[12]=0007; +DLGLOBAL DEBUG profile[13]=0107; +DLGLOBAL DEBUG profile[14]=0008; +DLGLOBAL DEBUG profile[15]=0108; +DLGLOBAL DEBUG } +DLGLOBAL DEBUG } +DLGLOBAL DEBUG SNME(e1c5d364) Rejecting RFC1144 header compression... +DLGLOBAL DEBUG SNME(e1c5d364) Rejecting ROHC header compression... +DLGLOBAL INFO Rx from lower layers: LL-UNITDATA.indication +DLGLOBAL INFO Rx from upper layers: SN-UNITDATA.request +DLGLOBAL INFO Rx from SNDCP SM sublayer: SNSM-DEACTIVATE.indication +DLGLOBAL DEBUG SNE(e1c5d364,SNDCP3,5) free() +DLGLOBAL DEBUG SNME(e1c5d364) No SNDCP Entities left activate, freeing SNME +DLGLOBAL DEBUG SNME(e1c5d364) free() diff --git a/tests/sndcp/sndcp_prim_test.ok b/tests/sndcp/sndcp_prim_test.ok index 4a635fc..621aea7 100644 --- a/tests/sndcp/sndcp_prim_test.ok +++ b/tests/sndcp/sndcp_prim_test.ok @@ -1,7 +1,14 @@ -==== test_sndcp_prim() [start] ==== -test_sndcp_prim_down_cb(): Rx LL-XID.request +==== test_sndcp_prim_net() [start] ==== test_sndcp_prim_up_cb(): Rx SN-XID.indication test_sndcp_prim_down_cb(): Rx LL-XID.response test_sndcp_prim_up_cb(): Rx SN-UNITDATA.indication TLLI=0xe1c5d364 SAPI=SNDCP3 NSAPI=5 NPDU=[75 22 fa 7c ff d9 56 ba 86 c7 2a f3 d2 1d ce bc 88 3a 8e b6 24 7d de 26 6a 58 de 29 be 96 d2 40 94 7f 9f 4d f5 9c 61 d4 19 e9 9a 58 75 21 21 a9 fd 1f d7 96 90 a7 3f fe 5b 59 f0 e7 c1 52 2c aa a1 39 b6 c5 fd 68 2e fc f4 c0 10 9b 7a 64 9d ae 3a ff a3 0f b0 56 7d 4b 52 33 74 13 67 44 6a ce 62 45 ea cb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] test_sndcp_prim_down_cb(): Rx LL-UNITDATA.request TLLI=0xe1c5d364 SAPI=SNDCP3 L3=[65 00 00 00 73 6f 6d 65 2d 6e 70 64 75 2d 64 61 74 61 2d 6c 69 6b 65 2d 61 6e 2d 69 70 2d 70 6b 74 00 ] -==== test_sndcp_prim() [end] ==== +==== test_sndcp_prim_net() [end] ==== +==== test_sndcp_prim_ms() [start] ==== +test_sndcp_prim_down_cb(): Rx LL-XID.request +test_sndcp_prim_snsm_cb(): Rx SNSM-ACTIVATE.response +test_sndcp_prim_down_cb(): Rx LL-XID.request +test_sndcp_prim_up_cb(): Rx SN-XID.confirm +test_sndcp_prim_up_cb(): Rx SN-UNITDATA.indication TLLI=0xe1c5d364 SAPI=SNDCP3 NSAPI=5 NPDU=[75 22 fa 7c ff d9 56 ba 86 c7 2a f3 d2 1d ce bc 88 3a 8e b6 24 7d de 26 6a 58 de 29 be 96 d2 40 94 7f 9f 4d f5 9c 61 d4 19 e9 9a 58 75 21 21 a9 fd 1f d7 96 90 a7 3f fe 5b 59 f0 e7 c1 52 2c aa a1 39 b6 c5 fd 68 2e fc f4 c0 10 9b 7a 64 9d ae 3a ff a3 0f b0 56 7d 4b 52 33 74 13 67 44 6a ce 62 45 ea cb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] +test_sndcp_prim_down_cb(): Rx LL-UNITDATA.request TLLI=0xe1c5d364 SAPI=SNDCP3 L3=[65 00 00 00 73 6f 6d 65 2d 6e 70 64 75 2d 64 61 74 61 2d 6c 69 6b 65 2d 61 6e 2d 69 70 2d 70 6b 74 00 ] +==== test_sndcp_prim_ms() [end] ==== diff --git a/tests/sndcp/sndcp_xid_test.c b/tests/sndcp/sndcp_xid_test.c index 8016dd0..63a479a 100644 --- a/tests/sndcp/sndcp_xid_test.c +++ b/tests/sndcp/sndcp_xid_test.c @@ -270,7 +270,7 @@ log_ctx = talloc_named_const(xid_ctx, 0, "log"); osmo_init_logging2(log_ctx, &info);
- rc = osmo_gprs_sndcp_init(); + rc = osmo_gprs_sndcp_init(OSMO_GPRS_SNDCP_LOCATION_MS); OSMO_ASSERT(rc == 0); osmo_gprs_sndcp_set_log_cat(OSMO_GPRS_SNDCP_LOGC_SNDCP, DSNDCP);