This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
lynxis lazus gerrit-no-reply at lists.osmocom.orglynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22427 ) Change subject: gprs_ns2: drop prefix of all internal exposed function ...................................................................... gprs_ns2: drop prefix of all internal exposed function All functions which are exposed by gprs_ns2_internal.h should not contain the public prefix gprs_. Internal function should only contain ns2_ prefix. Change-Id: Icecc5a918902cd10efac72bbac20780d39aab272 --- M src/gb/gprs_ns2.c M src/gb/gprs_ns2_fr.c M src/gb/gprs_ns2_frgre.c M src/gb/gprs_ns2_internal.h M src/gb/gprs_ns2_message.c M src/gb/gprs_ns2_sns.c M src/gb/gprs_ns2_udp.c M src/gb/gprs_ns2_vc_fsm.c M src/gb/gprs_ns2_vty.c M src/gb/gprs_ns2_vty2.c M tests/gb/gprs_ns2_test.c 11 files changed, 84 insertions(+), 86 deletions(-) Approvals: Jenkins Builder: Verified daniel: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve lynxis lazus: Looks good to me, approved diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c index 2c417f2..811294b 100644 --- a/src/gb/gprs_ns2.c +++ b/src/gb/gprs_ns2.c @@ -318,7 +318,7 @@ llist_for_each_entry(tmp, &nse->nsvc, list) { if (tmp->sig_weight == 0) continue; - if (!gprs_ns2_vc_is_unblocked(tmp)) + if (!ns2_vc_is_unblocked(tmp)) continue; if (tmp->sig_counter == 0) { last = tmp; @@ -354,7 +354,7 @@ uint32_t i = 0; llist_for_each_entry(tmp, &nse->nsvc, list) { - if (!gprs_ns2_vc_is_unblocked(tmp)) + if (!ns2_vc_is_unblocked(tmp)) continue; if (i == mod) return tmp; @@ -370,7 +370,7 @@ struct gprs_ns2_vc *nsvc = NULL, *tmp; llist_for_each_entry(tmp, &nse->nsvc, list) { - if (!gprs_ns2_vc_is_unblocked(tmp)) + if (!ns2_vc_is_unblocked(tmp)) continue; if (tmp->data_weight == 0) continue; @@ -512,7 +512,7 @@ nsvc->statg = osmo_stat_item_group_alloc(nsvc, &nsvc_statg_desc, bind->nsi->rate_ctr_idx); if (!nsvc->statg) goto err_group; - if (!gprs_ns2_vc_fsm_alloc(nsvc, id, initiater)) + if (!ns2_vc_fsm_alloc(nsvc, id, initiater)) goto err_statg; bind->nsi->rate_ctr_idx++; @@ -577,7 +577,7 @@ } /*! Allocate a message buffer for use with the NS2 stack. */ -struct msgb *gprs_ns2_msgb_alloc(void) +struct msgb *ns2_msgb_alloc(void) { struct msgb *msg = msgb_alloc_headroom(NS_ALLOC_SIZE, NS_ALLOC_HEADROOM, "GPRS/NS"); @@ -596,7 +596,7 @@ * \return 0 on success */ static int reject_status_msg(struct msgb *orig_msg, struct tlv_parsed *tp, struct msgb **reject, enum ns_cause cause) { - struct msgb *msg = gprs_ns2_msgb_alloc(); + struct msgb *msg = ns2_msgb_alloc(); struct gprs_ns_hdr *nsh; bool have_vci = false; uint8_t _cause = cause; @@ -910,7 +910,7 @@ } nsvci = tlvp_val16be(&tp, NS_IE_VCI); - vc_mode = gprs_ns2_dialect_to_vc_mode(dialect); + vc_mode = ns2_dialect_to_vc_mode(dialect); snprintf(idbuf, sizeof(idbuf), "%s-NSE%05u-NSVC%05u", gprs_ns2_lltype_str(nse->ll), nse->nsei, nsvci); nsvc = ns2_vc_alloc(bind, nse, false, vc_mode, idbuf); @@ -938,7 +938,7 @@ { struct gprs_ns2_vc *nsvc; - nsvc = gprs_ns2_ip_bind_connect(bind, nse, remote); + nsvc = ns2_ip_bind_connect(bind, nse, remote); if (!nsvc) return NULL; @@ -966,7 +966,7 @@ if (!nsvc) return NULL; - gprs_ns2_vc_fsm_start(nsvc); + ns2_vc_fsm_start(nsvc); return nsvc; } @@ -1066,7 +1066,7 @@ return rc; } /* All sub-network service related message types */ - rc = gprs_ns2_sns_rx(nsvc, msg, &tp); + rc = ns2_sns_rx(nsvc, msg, &tp); break; case SNS_PDUT_ACK: case SNS_PDUT_ADD: @@ -1083,7 +1083,7 @@ tp.lv[NS_IE_NSEI].len = 2; tp.lv[NS_IE_TRANS_ID].val = nsh->data+4; tp.lv[NS_IE_TRANS_ID].len = 1; - rc = gprs_ns2_sns_rx(nsvc, msg, &tp); + rc = ns2_sns_rx(nsvc, msg, &tp); break; case SNS_PDUT_CONFIG_ACK: case SNS_PDUT_SIZE: @@ -1095,11 +1095,11 @@ return rc; } /* All sub-network service related message types */ - rc = gprs_ns2_sns_rx(nsvc, msg, &tp); + rc = ns2_sns_rx(nsvc, msg, &tp); break; case NS_PDUT_UNITDATA: - rc = gprs_ns2_vc_rx(nsvc, msg, &tp); + rc = ns2_vc_rx(nsvc, msg, &tp); break; default: rc = ns2_tlv_parse(&tp, nsh->data, @@ -1110,7 +1110,7 @@ ns2_tx_status(nsvc, NS_CAUSE_PROTO_ERR_UNSPEC, 0, msg); return rc; } - rc = gprs_ns2_vc_rx(nsvc, msg, &tp); + rc = ns2_vc_rx(nsvc, msg, &tp); break; } @@ -1127,7 +1127,7 @@ nse->sum_sig_weight = 0; llist_for_each_entry(nsvc, &nse->nsvc, list) { - if (!gprs_ns2_vc_is_unblocked(nsvc)) + if (!ns2_vc_is_unblocked(nsvc)) continue; nse->nsvc_count++; @@ -1231,7 +1231,7 @@ if (nsvc->sns_only) continue; - gprs_ns2_vc_fsm_start(nsvc); + ns2_vc_fsm_start(nsvc); } } @@ -1269,8 +1269,7 @@ * \param[in] name The unique bind name to search for * \return the bind or NULL if not found */ -struct gprs_ns2_vc_bind *gprs_ns2_bind_by_name( - struct gprs_ns2_inst *nsi, const char *name) +struct gprs_ns2_vc_bind *gprs_ns2_bind_by_name(struct gprs_ns2_inst *nsi, const char *name) { struct gprs_ns2_vc_bind *bind; @@ -1282,8 +1281,7 @@ return NULL; } -enum gprs_ns2_vc_mode gprs_ns2_dialect_to_vc_mode( - enum gprs_ns2_dialect dialect) +enum gprs_ns2_vc_mode ns2_dialect_to_vc_mode(enum gprs_ns2_dialect dialect) { switch (dialect) { case NS2_DIALECT_SNS: @@ -1335,7 +1333,7 @@ return 0; llist_for_each_entry(nsvc, &nse->nsvc, list) { - if (gprs_ns2_vc_is_unblocked(nsvc)) + if (ns2_vc_is_unblocked(nsvc)) active_nsvcs++; } /* an alive nse should always have active_nsvcs */ @@ -1346,7 +1344,7 @@ return -ENOMEM; llist_for_each_entry(nsvc, &nse->nsvc, list) { - if (!gprs_ns2_vc_is_unblocked(nsvc)) + if (!ns2_vc_is_unblocked(nsvc)) continue; add_bind_array(active_binds, nsvc->bind, active_nsvcs); } diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c index 274ed96..8ad44ac 100644 --- a/src/gb/gprs_ns2_fr.c +++ b/src/gb/gprs_ns2_fr.c @@ -762,7 +762,7 @@ nsvc->nsvci = nsvci; nsvc->nsvci_is_valid = true; - gprs_ns2_vc_fsm_start(nsvc); + ns2_vc_fsm_start(nsvc); return nsvc; diff --git a/src/gb/gprs_ns2_frgre.c b/src/gb/gprs_ns2_frgre.c index da7e53f..cc8500f 100644 --- a/src/gb/gprs_ns2_frgre.c +++ b/src/gb/gprs_ns2_frgre.c @@ -451,7 +451,7 @@ goto out; case NS2_CS_CREATED: frgre_alloc_vc(bind, nsvc, &saddr, dlci); - gprs_ns2_vc_fsm_start(nsvc); + ns2_vc_fsm_start(nsvc); break; } } diff --git a/src/gb/gprs_ns2_internal.h b/src/gb/gprs_ns2_internal.h index a36396f..027071d 100644 --- a/src/gb/gprs_ns2_internal.h +++ b/src/gb/gprs_ns2_internal.h @@ -260,10 +260,10 @@ enum gprs_ns2_vc_mode vc_mode, const char *id); -struct msgb *gprs_ns2_msgb_alloc(void); +struct msgb *ns2_msgb_alloc(void); -void gprs_ns2_sns_write_vty(struct vty *vty, const struct gprs_ns2_nse *nse); -void gprs_ns2_sns_dump_vty(struct vty *vty, const char *prefix, const struct gprs_ns2_nse *nse, bool stats); +void ns2_sns_write_vty(struct vty *vty, const struct gprs_ns2_nse *nse); +void ns2_sns_dump_vty(struct vty *vty, const char *prefix, const struct gprs_ns2_nse *nse, bool stats); void ns2_prim_status_ind(struct gprs_ns2_nse *nse, struct gprs_ns2_vc *nsvc, uint16_t bvci, @@ -271,11 +271,11 @@ void ns2_nse_notify_alive(struct gprs_ns2_vc *nsvc, bool alive); /* message */ -int gprs_ns2_validate(struct gprs_ns2_vc *nsvc, - uint8_t pdu_type, - struct msgb *msg, - struct tlv_parsed *tp, - uint8_t *cause); +int ns2_validate(struct gprs_ns2_vc *nsvc, + uint8_t pdu_type, + struct msgb *msg, + struct tlv_parsed *tp, + uint8_t *cause); /* SNS messages */ int ns2_tx_sns_ack(struct gprs_ns2_vc *nsvc, uint8_t trans_id, uint8_t *cause, @@ -314,33 +314,33 @@ uint16_t bvci, struct msgb *orig_msg); /* driver */ -struct gprs_ns2_vc *gprs_ns2_ip_bind_connect(struct gprs_ns2_vc_bind *bind, - struct gprs_ns2_nse *nse, - const struct osmo_sockaddr *remote); +struct gprs_ns2_vc *ns2_ip_bind_connect(struct gprs_ns2_vc_bind *bind, + struct gprs_ns2_nse *nse, + const struct osmo_sockaddr *remote); int ns2_ip_count_bind(struct gprs_ns2_inst *nsi, struct osmo_sockaddr *remote); struct gprs_ns2_vc_bind *ns2_ip_get_bind_by_index(struct gprs_ns2_inst *nsi, struct osmo_sockaddr *remote, int index); /* sns */ -int gprs_ns2_sns_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp); +int ns2_sns_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp); struct osmo_fsm_inst *ns2_sns_bss_fsm_alloc(struct gprs_ns2_nse *nse, const char *id); void ns2_sns_free_nsvc(struct gprs_ns2_vc *nsvc); /* vc */ -struct osmo_fsm_inst *gprs_ns2_vc_fsm_alloc(struct gprs_ns2_vc *nsvc, +struct osmo_fsm_inst *ns2_vc_fsm_alloc(struct gprs_ns2_vc *nsvc, const char *id, bool initiate); -int gprs_ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc); -int gprs_ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc); -int gprs_ns2_vc_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp); -int gprs_ns2_vc_is_alive(struct gprs_ns2_vc *nsvc); -int gprs_ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc); +int ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc); +int ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc); +int ns2_vc_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp); +int ns2_vc_is_alive(struct gprs_ns2_vc *nsvc); +int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc); int ns2_vc_block(struct gprs_ns2_vc *nsvc); int ns2_vc_unblock(struct gprs_ns2_vc *nsvc); /* nse */ void ns2_nse_notify_unblocked(struct gprs_ns2_vc *nsvc, bool unblocked); -enum gprs_ns2_vc_mode gprs_ns2_dialect_to_vc_mode(enum gprs_ns2_dialect dialect); +enum gprs_ns2_vc_mode ns2_dialect_to_vc_mode(enum gprs_ns2_dialect dialect); int ns2_count_transfer_cap(struct gprs_ns2_nse *nse, uint16_t bvci); diff --git a/src/gb/gprs_ns2_message.c b/src/gb/gprs_ns2_message.c index 9559229..a185f3b 100644 --- a/src/gb/gprs_ns2_message.c +++ b/src/gb/gprs_ns2_message.c @@ -149,11 +149,11 @@ return 0; } -int gprs_ns2_validate(struct gprs_ns2_vc *nsvc, - uint8_t pdu_type, - struct msgb *msg, - struct tlv_parsed *tp, - uint8_t *cause) +int ns2_validate(struct gprs_ns2_vc *nsvc, + uint8_t pdu_type, + struct msgb *msg, + struct tlv_parsed *tp, + uint8_t *cause) { switch (pdu_type) { case NS_PDUT_RESET: @@ -186,7 +186,7 @@ /* transmit functions */ static int ns2_tx_simple(struct gprs_ns2_vc *nsvc, uint8_t pdu_type) { - struct msgb *msg = gprs_ns2_msgb_alloc(); + struct msgb *msg = ns2_msgb_alloc(); struct gprs_ns_hdr *nsh; log_set_context(LOG_CTX_GB_NSE, nsvc->nse); @@ -218,7 +218,7 @@ ERR_IF_NSVC_USES_SNS(nsvc, "transmit NS BLOCK"); - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); if (!msg) return -ENOMEM; @@ -250,7 +250,7 @@ ERR_IF_NSVC_USES_SNS(nsvc, "transmit NS BLOCK ACK"); - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); if (!msg) return -ENOMEM; @@ -281,7 +281,7 @@ ERR_IF_NSVC_USES_SNS(nsvc, "transmit NS RESET"); - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); if (!msg) return -ENOMEM; @@ -313,7 +313,7 @@ ERR_IF_NSVC_USES_SNS(nsvc, "transmit NS RESET ACK"); - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); if (!msg) return -ENOMEM; @@ -428,7 +428,7 @@ int ns2_tx_status(struct gprs_ns2_vc *nsvc, uint8_t cause, uint16_t bvci, struct msgb *orig_msg) { - struct msgb *msg = gprs_ns2_msgb_alloc(); + struct msgb *msg = ns2_msgb_alloc(); struct gprs_ns_hdr *nsh; uint16_t nsvci = osmo_htons(nsvc->nsvci); @@ -495,7 +495,7 @@ if (!nsvc) return -1; - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); log_set_context(LOG_CTX_GB_NSE, nsvc->nse); log_set_context(LOG_CTX_GB_NSVC, nsvc); @@ -553,7 +553,7 @@ if (!nsvc) return -1; - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); log_set_context(LOG_CTX_GB_NSE, nsvc->nse); log_set_context(LOG_CTX_GB_NSVC, nsvc); @@ -602,7 +602,7 @@ if (!nsvc) return -1; - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); log_set_context(LOG_CTX_GB_NSE, nsvc->nse); log_set_context(LOG_CTX_GB_NSVC, nsvc); if (!msg) @@ -646,7 +646,7 @@ if (!nsvc) return -1; - msg = gprs_ns2_msgb_alloc(); + msg = ns2_msgb_alloc(); log_set_context(LOG_CTX_GB_NSE, nsvc->nse); log_set_context(LOG_CTX_GB_NSVC, nsvc); @@ -683,7 +683,7 @@ * \returns 0 on success; negative in case of error */ int ns2_tx_sns_size_ack(struct gprs_ns2_vc *nsvc, uint8_t *cause) { - struct msgb *msg = gprs_ns2_msgb_alloc(); + struct msgb *msg = ns2_msgb_alloc(); struct gprs_ns_hdr *nsh; uint16_t nsei; diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c index 90d97b6..2dc6524 100644 --- a/src/gb/gprs_ns2_sns.c +++ b/src/gb/gprs_ns2_sns.c @@ -246,7 +246,7 @@ if (nse->alive) { /* choose a different sns nsvc */ llist_for_each_entry(tmp, &nse->nsvc, list) { - if (gprs_ns2_vc_is_unblocked(tmp)) + if (ns2_vc_is_unblocked(tmp)) gss->sns_nsvc = tmp; } } else { @@ -743,7 +743,7 @@ /* setup the NSVC */ if (!gss->sns_nsvc) { - gss->sns_nsvc = gprs_ns2_ip_bind_connect(bind, gss->nse, remote); + gss->sns_nsvc = ns2_ip_bind_connect(bind, gss->nse, remote); if (!gss->sns_nsvc) return; gss->sns_nsvc->sns_only = true; @@ -1439,7 +1439,7 @@ * \param[in] msg message buffer of the IP-SNS message * \param[in] tp parsed TLV structure of message * \retruns 0 on success; negative on error */ -int gprs_ns2_sns_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp) +int ns2_sns_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp) { struct gprs_ns2_nse *nse = nsvc->nse; struct gprs_ns_hdr *nsh = (struct gprs_ns_hdr *) msg->l2h; @@ -1521,7 +1521,7 @@ * \param[in] prefix prefix to print at start of each line (typically indenting) * \param[in] nse NS Entity whose IP-SNS state shall be printed * \param[in] stats Whether or not statistics shall also be printed */ -void gprs_ns2_sns_dump_vty(struct vty *vty, const char *prefix, const struct gprs_ns2_nse *nse, bool stats) +void ns2_sns_dump_vty(struct vty *vty, const char *prefix, const struct gprs_ns2_nse *nse, bool stats) { struct ns2_sns_state *gss; unsigned int i; @@ -1559,7 +1559,7 @@ /*! write IP-SNS to a vty * \param[in] vty VTY to which the state shall be printed * \param[in] nse NS Entity whose IP-SNS state shall be printed */ -void gprs_ns2_sns_write_vty(struct vty *vty, const struct gprs_ns2_nse *nse) +void ns2_sns_write_vty(struct vty *vty, const struct gprs_ns2_nse *nse) { struct ns2_sns_state *gss; struct osmo_sockaddr_str addr_str; diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c index 6ee6eb2..e1ffad6 100644 --- a/src/gb/gprs_ns2_udp.c +++ b/src/gb/gprs_ns2_udp.c @@ -171,7 +171,7 @@ static struct msgb *read_nsip_msg(struct osmo_fd *bfd, int *error, struct osmo_sockaddr *saddr, const struct gprs_ns2_vc_bind *bind) { - struct msgb *msg = gprs_ns2_msgb_alloc(); + struct msgb *msg = ns2_msgb_alloc(); int ret = 0; socklen_t saddr_len = sizeof(*saddr); @@ -243,7 +243,7 @@ goto out; case NS2_CS_CREATED: ns2_driver_alloc_vc(bind, nsvc, &saddr); - gprs_ns2_vc_fsm_start(nsvc); + ns2_vc_fsm_start(nsvc); break; } } @@ -394,9 +394,9 @@ * \param[in] nse NS entity to be used for the new NS-VC * \param[in] remote remote address to connect to * \return pointer to newly-allocated and connected NS-VC; NULL on error */ -struct gprs_ns2_vc *gprs_ns2_ip_bind_connect(struct gprs_ns2_vc_bind *bind, - struct gprs_ns2_nse *nse, - const struct osmo_sockaddr *remote) +struct gprs_ns2_vc *ns2_ip_bind_connect(struct gprs_ns2_vc_bind *bind, + struct gprs_ns2_nse *nse, + const struct osmo_sockaddr *remote) { struct gprs_ns2_vc *nsvc; struct priv_vc *priv; @@ -406,7 +406,7 @@ OSMO_ASSERT(gprs_ns2_is_ip_bind(bind)); - vc_mode = gprs_ns2_dialect_to_vc_mode(nse->dialect); + vc_mode = ns2_dialect_to_vc_mode(nse->dialect); if ((int) vc_mode == -1) { LOGNSE(nse, LOGL_ERROR, "Can not derive vc mode from dialect %d. Maybe libosmocore is too old.\n", nse->dialect); diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c index d4f4320..d18983a 100644 --- a/src/gb/gprs_ns2_vc_fsm.c +++ b/src/gb/gprs_ns2_vc_fsm.c @@ -684,7 +684,7 @@ * \param initiator initiator is the site which starts the connection. Usually the BSS. * \return NULL on error, otherwise the fsm */ -struct osmo_fsm_inst *gprs_ns2_vc_fsm_alloc(struct gprs_ns2_vc *nsvc, +struct osmo_fsm_inst *ns2_vc_fsm_alloc(struct gprs_ns2_vc *nsvc, const char *id, bool initiator) { struct osmo_fsm_inst *fi; @@ -707,7 +707,7 @@ /*! Start a NS-VC FSM. * \param nsvc the virtual circuit * \return 0 on success; negative on error */ -int gprs_ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc) +int ns2_vc_fsm_start(struct gprs_ns2_vc *nsvc) { /* allows to call this function even for started nsvc by gprs_ns2_start_alive_all_nsvcs */ if (nsvc->fi->state == GPRS_NS2_ST_UNCONFIGURED) @@ -718,7 +718,7 @@ /*! Reset a NS-VC FSM. * \param nsvc the virtual circuit * \return 0 on success; negative on error */ -int gprs_ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc) +int ns2_vc_force_unconfigured(struct gprs_ns2_vc *nsvc) { return osmo_fsm_inst_dispatch(nsvc->fi, GPRS_NS2_EV_REQ_FORCE_UNCONFIGURED, NULL); } @@ -744,7 +744,7 @@ * \param msg message that was received * \param tp parsed TLVs of the received message * \return 0 on success; negative on error */ -int gprs_ns2_vc_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp) +int ns2_vc_rx(struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp) { struct gprs_ns_hdr *nsh = (struct gprs_ns_hdr *) msg->l2h; struct osmo_fsm_inst *fi = nsvc->fi; @@ -756,7 +756,7 @@ * if not answer STATUS with "NS-VC unknown" */ /* TODO: handle BLOCK/UNBLOCK/ALIVE with different VCI */ - if (gprs_ns2_validate(nsvc, nsh->pdu_type, msg, tp, &cause)) { + if (ns2_validate(nsvc, nsh->pdu_type, msg, tp, &cause)) { if (nsh->pdu_type != NS_PDUT_STATUS) { rc = ns2_tx_status(nsvc, cause, 0, msg); goto out; @@ -831,7 +831,7 @@ } /*! is the given NS-VC unblocked? */ -int gprs_ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc) +int ns2_vc_is_unblocked(struct gprs_ns2_vc *nsvc) { return (nsvc->fi->state == GPRS_NS2_ST_UNBLOCKED); } diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c index 36a7f78..d6674ff 100644 --- a/src/gb/gprs_ns2_vty.c +++ b/src/gb/gprs_ns2_vty.c @@ -298,7 +298,7 @@ vty_out(vty, "NSEI %05u: %s, %s%s", nse->nsei, gprs_ns2_lltype_str(nse->ll), nse->alive ? "ALIVE" : "DEAD", VTY_NEWLINE); - gprs_ns2_sns_dump_vty(vty, " ", nse, stats); + ns2_sns_dump_vty(vty, " ", nse, stats); llist_for_each_entry(nsvc, &nse->nsvc, list) { if (persistent_only) { if (nsvc->persistent) @@ -418,7 +418,7 @@ static int nsvc_force_unconf_cb(struct gprs_ns2_vc *nsvc, void *ctx) { - gprs_ns2_vc_force_unconfigured(nsvc); + ns2_vc_force_unconfigured(nsvc); return 0; } diff --git a/src/gb/gprs_ns2_vty2.c b/src/gb/gprs_ns2_vty2.c index db59717..43dd263 100644 --- a/src/gb/gprs_ns2_vty2.c +++ b/src/gb/gprs_ns2_vty2.c @@ -391,7 +391,7 @@ vty_out(vty, " nse %u%s", nse->nsei, VTY_NEWLINE); switch (nse->dialect) { case NS2_DIALECT_SNS: - gprs_ns2_sns_write_vty(vty, nse); + ns2_sns_write_vty(vty, nse); break; default: llist_for_each_entry(nsvc, &nse->nsvc, list) { @@ -1349,7 +1349,7 @@ vty_out(vty, "NSEI %05u: %s, %s%s", nse->nsei, gprs_ns2_lltype_str(nse->ll), nse->alive ? "ALIVE" : "DEAD", VTY_NEWLINE); - gprs_ns2_sns_dump_vty(vty, " ", nse, stats); + ns2_sns_dump_vty(vty, " ", nse, stats); llist_for_each_entry(nsvc, &nse->nsvc, list) { if (persistent_only) { if (nsvc->persistent) @@ -1469,7 +1469,7 @@ static int nsvc_force_unconf_cb(struct gprs_ns2_vc *nsvc, void *ctx) { - gprs_ns2_vc_force_unconfigured(nsvc); + ns2_vc_force_unconfigured(nsvc); return 0; } diff --git a/tests/gb/gprs_ns2_test.c b/tests/gb/gprs_ns2_test.c index 10f430d..335a079 100644 --- a/tests/gb/gprs_ns2_test.c +++ b/tests/gb/gprs_ns2_test.c @@ -254,7 +254,7 @@ OSMO_ASSERT(nsvc[i]); nsvc[i]->fi->state = 3; /* HACK: 3 = GPRS_NS2_ST_UNBLOCKED */ /* ensure the fi->state works correct */ - OSMO_ASSERT(gprs_ns2_vc_is_unblocked(nsvc[i])); + OSMO_ASSERT(ns2_vc_is_unblocked(nsvc[i])); ns2_nse_notify_unblocked(nsvc[i], true); } @@ -277,7 +277,7 @@ nsh->pdu_type = NS_PDUT_UNBLOCK_ACK; ns2_recv_vc(nsvc[0], msg); - OSMO_ASSERT(gprs_ns2_vc_is_unblocked(nsvc[0])); + OSMO_ASSERT(ns2_vc_is_unblocked(nsvc[0])); gprs_ns2_free(nsi); printf("--- Finish NSE block unblock nsvc\n"); } @@ -330,11 +330,11 @@ nsvc[i] = ns2_vc_alloc(bind[i], nse, false, NS2_VC_MODE_BLOCKRESET, idbuf); loop[i] = loopback_nsvc(loopbind, nsvc[i]); OSMO_ASSERT(nsvc[i]); - gprs_ns2_vc_fsm_start(nsvc[i]); - OSMO_ASSERT(!gprs_ns2_vc_is_unblocked(nsvc[i])); + ns2_vc_fsm_start(nsvc[i]); + OSMO_ASSERT(!ns2_vc_is_unblocked(nsvc[i])); ns2_tx_reset(loop[i], NS_CAUSE_OM_INTERVENTION); ns2_tx_unblock(loop[i]); - OSMO_ASSERT(gprs_ns2_vc_is_unblocked(nsvc[i])); + OSMO_ASSERT(ns2_vc_is_unblocked(nsvc[i])); } /* both nsvcs are unblocked and alive */ -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22427 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Icecc5a918902cd10efac72bbac20780d39aab272 Gerrit-Change-Number: 22427 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis at fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann at sysmocom.de> Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210125/100a55e9/attachment.htm>