aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-01-25 16:23:29 +0100
committerpespin <pespin@sysmocom.de>2021-01-28 11:56:37 +0000
commit138b96f21c0992a768517011647f4e44a5912f3a (patch)
treeab2d72b28c5e805289e9496a72ddbb93000f0fe2 /src
parentf2afb98c833ce4a4b9c95b9b7977b1cb80d5e89f (diff)
gprs_ns2: refactor: ensure all enums have GPRS_NS2_
All public enum should have the prefix GPRS_NS2_. API change which must be synchronized with osmo-pcu, osmo-gbproxy, osmo-sgsn. Change-Id: I548ff12f7277cbb7e1a630a3dc02b738ce89be72
Diffstat (limited to 'src')
-rw-r--r--src/gb/gprs_bssgp2.c2
-rw-r--r--src/gb/gprs_ns2.c54
-rw-r--r--src/gb/gprs_ns2_fr.c4
-rw-r--r--src/gb/gprs_ns2_sns.c12
-rw-r--r--src/gb/gprs_ns2_udp.c2
-rw-r--r--src/gb/gprs_ns2_vc_fsm.c14
-rw-r--r--src/gb/gprs_ns2_vty.c24
-rw-r--r--src/gb/gprs_ns2_vty2.c68
8 files changed, 90 insertions, 90 deletions
diff --git a/src/gb/gprs_bssgp2.c b/src/gb/gprs_bssgp2.c
index 5a8d41f6..0f519adb 100644
--- a/src/gb/gprs_bssgp2.c
+++ b/src/gb/gprs_bssgp2.c
@@ -52,7 +52,7 @@ int bssgp2_nsi_tx_ptp(struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci,
nsp.nsei = nsei;
nsp.u.unitdata.link_selector = lsp;
- osmo_prim_init(&nsp.oph, SAP_NS, PRIM_NS_UNIT_DATA, PRIM_OP_REQUEST, msg);
+ osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA, PRIM_OP_REQUEST, msg);
rc = gprs_ns2_recv_prim(nsi, &nsp.oph);
return rc;
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 811294bc..7e273fb6 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -196,19 +196,19 @@ static const struct osmo_stat_item_group_desc nsvc_statg_desc = {
};
const struct value_string gprs_ns2_aff_cause_prim_strs[] = {
- { NS_AFF_CAUSE_VC_FAILURE, "NSVC failure" },
- { NS_AFF_CAUSE_VC_RECOVERY, "NSVC recovery" },
- { NS_AFF_CAUSE_FAILURE, "NSE failure" },
- { NS_AFF_CAUSE_RECOVERY, "NSE recovery" },
- { NS_AFF_CAUSE_SNS_CONFIGURED, "NSE SNS configured" },
- { NS_AFF_CAUSE_SNS_FAILURE, "NSE SNS failure" },
+ { GPRS_NS2_AFF_CAUSE_VC_FAILURE, "NSVC failure" },
+ { GPRS_NS2_AFF_CAUSE_VC_RECOVERY, "NSVC recovery" },
+ { GPRS_NS2_AFF_CAUSE_FAILURE, "NSE failure" },
+ { GPRS_NS2_AFF_CAUSE_RECOVERY, "NSE recovery" },
+ { GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED, "NSE SNS configured" },
+ { GPRS_NS2_AFF_CAUSE_SNS_FAILURE, "NSE SNS failure" },
{ 0, NULL }
};
const struct value_string gprs_ns2_prim_strs[] = {
- { PRIM_NS_UNIT_DATA, "UNIT DATA" },
- { PRIM_NS_CONGESTION, "CONGESTION" },
- { PRIM_NS_STATUS, "STATUS" },
+ { GPRS_NS2_PRIM_UNIT_DATA, "UNIT DATA" },
+ { GPRS_NS2_PRIM_CONGESTION, "CONGESTION" },
+ { GPRS_NS2_PRIM_STATUS, "STATUS" },
{ 0, NULL }
};
@@ -429,7 +429,7 @@ int gprs_ns2_recv_prim(struct gprs_ns2_inst *nsi, struct osmo_prim_hdr *oph)
nsp = container_of(oph, struct osmo_gprs_ns2_prim, oph);
- if (oph->operation != PRIM_OP_REQUEST || oph->primitive != PRIM_NS_UNIT_DATA)
+ if (oph->operation != PRIM_OP_REQUEST || oph->primitive != GPRS_NS2_PRIM_UNIT_DATA)
return -EINVAL;
if (!oph->msg)
@@ -448,9 +448,9 @@ int gprs_ns2_recv_prim(struct gprs_ns2_inst *nsi, struct osmo_prim_hdr *oph)
if (!nsvc)
return 0;
- if (nsp->u.unitdata.change == NS_ENDPOINT_REQUEST_CHANGE)
+ if (nsp->u.unitdata.change == GPRS_NS2_ENDPOINT_REQUEST_CHANGE)
sducontrol = 1;
- else if (nsp->u.unitdata.change == NS_ENDPOINT_CONFIRM_CHANGE)
+ else if (nsp->u.unitdata.change == GPRS_NS2_ENDPOINT_CONFIRM_CHANGE)
sducontrol = 2;
return ns2_tx_unit_data(nsvc, bvci, sducontrol, oph->msg);
@@ -477,7 +477,7 @@ void ns2_prim_status_ind(struct gprs_ns2_nse *nse,
if (nsvc)
nsp.u.status.nsvc = gprs_ns2_ll_str_buf(nsvc_str, sizeof(nsvc_str), nsvc);
- osmo_prim_init(&nsp.oph, SAP_NS, PRIM_NS_STATUS,
+ osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_STATUS,
PRIM_OP_INDICATION, NULL);
nse->nsi->cb(&nsp.oph, nse->nsi->cb_data);
}
@@ -539,7 +539,7 @@ void gprs_ns2_free_nsvc(struct gprs_ns2_vc *nsvc)
if (!nsvc)
return;
- ns2_prim_status_ind(nsvc->nse, nsvc, 0, NS_AFF_CAUSE_VC_FAILURE);
+ ns2_prim_status_ind(nsvc->nse, nsvc, 0, GPRS_NS2_AFF_CAUSE_VC_FAILURE);
llist_del(&nsvc->list);
llist_del(&nsvc->blist);
@@ -703,7 +703,7 @@ struct gprs_ns2_nse *gprs_ns2_create_nse(struct gprs_ns2_inst *nsi, uint16_t nse
if (!nse)
return NULL;
- if (dialect == NS2_DIALECT_SNS) {
+ if (dialect == GPRS_NS2_DIALECT_SNS) {
snprintf(sns, sizeof(sns), "NSE%05u-SNS", nsei);
nse->bss_sns_fi = ns2_sns_bss_fsm_alloc(nse, sns);
if (!nse->bss_sns_fi) {
@@ -741,7 +741,7 @@ void gprs_ns2_free_nse(struct gprs_ns2_nse *nse)
nse->alive = false;
gprs_ns2_free_nsvcs(nse);
- ns2_prim_status_ind(nse, NULL, 0, NS_AFF_CAUSE_FAILURE);
+ ns2_prim_status_ind(nse, NULL, 0, GPRS_NS2_AFF_CAUSE_FAILURE);
llist_del(&nse->list);
if (nse->bss_sns_fi)
@@ -828,7 +828,7 @@ enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind,
case NS_PDUT_RESET:
/* accept PDU RESET when vc_mode matches */
if (bind->accept_ipaccess) {
- dialect = NS2_DIALECT_IPACCESS;
+ dialect = GPRS_NS2_DIALECT_IPACCESS;
break;
}
@@ -871,7 +871,7 @@ enum ns2_cs ns2_create_vc(struct gprs_ns2_vc_bind *bind,
nse = gprs_ns2_nse_by_nsei(bind->nsi, nsei);
if (!nse) {
/* only create nse for udp & ipaccess */
- if (bind->ll != GPRS_NS2_LL_UDP || dialect != NS2_DIALECT_IPACCESS)
+ if (bind->ll != GPRS_NS2_LL_UDP || dialect != GPRS_NS2_DIALECT_IPACCESS)
return NS2_CS_SKIPPED;
if (!bind->nsi->create_nse || !bind->accept_ipaccess)
@@ -942,7 +942,7 @@ struct gprs_ns2_vc *gprs_ns2_ip_connect_inactive(struct gprs_ns2_vc_bind *bind,
if (!nsvc)
return NULL;
- if (nsvc->mode == NS2_VC_MODE_BLOCKRESET) {
+ if (nsvc->mode == GPRS_NS2_VC_MODE_BLOCKRESET) {
nsvc->nsvci = nsvci;
nsvc->nsvci_is_valid = true;
}
@@ -1151,7 +1151,7 @@ void ns2_nse_notify_unblocked(struct gprs_ns2_vc *nsvc, bool unblocked)
/* wait until both data_weight and sig_weight are != 0 before declaring NSE as alive */
if (unblocked && nse->sum_data_weight && nse->sum_sig_weight) {
nse->alive = true;
- ns2_prim_status_ind(nse, NULL, 0, NS_AFF_CAUSE_RECOVERY);
+ ns2_prim_status_ind(nse, NULL, 0, GPRS_NS2_AFF_CAUSE_RECOVERY);
nse->first = false;
return;
}
@@ -1159,7 +1159,7 @@ void ns2_nse_notify_unblocked(struct gprs_ns2_vc *nsvc, bool unblocked)
if (nse->alive && (nse->sum_data_weight == 0 || nse->sum_sig_weight == 0)) {
/* nse became unavailable */
nse->alive = false;
- ns2_prim_status_ind(nse, NULL, 0, NS_AFF_CAUSE_FAILURE);
+ ns2_prim_status_ind(nse, NULL, 0, GPRS_NS2_AFF_CAUSE_FAILURE);
}
}
@@ -1284,12 +1284,12 @@ struct gprs_ns2_vc_bind *gprs_ns2_bind_by_name(struct gprs_ns2_inst *nsi, const
enum gprs_ns2_vc_mode ns2_dialect_to_vc_mode(enum gprs_ns2_dialect dialect)
{
switch (dialect) {
- case NS2_DIALECT_SNS:
- case NS2_DIALECT_STATIC_ALIVE:
- return NS2_VC_MODE_ALIVE;
- case NS2_DIALECT_STATIC_RESETBLOCK:
- case NS2_DIALECT_IPACCESS:
- return NS2_VC_MODE_BLOCKRESET;
+ case GPRS_NS2_DIALECT_SNS:
+ case GPRS_NS2_DIALECT_STATIC_ALIVE:
+ return GPRS_NS2_VC_MODE_ALIVE;
+ case GPRS_NS2_DIALECT_STATIC_RESETBLOCK:
+ case GPRS_NS2_DIALECT_IPACCESS:
+ return GPRS_NS2_VC_MODE_BLOCKRESET;
default:
return -1;
}
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 8ad44ac9..1c88db63 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -751,7 +751,7 @@ struct gprs_ns2_vc *gprs_ns2_fr_connect(struct gprs_ns2_vc_bind *bind,
snprintf(idbuf, sizeof(idbuf), "%s-%s-DLCI%u-NSE%05u-NSVC%05u", gprs_ns2_lltype_str(nse->ll),
bpriv->netif, dlci, nse->nsei, nsvci);
- nsvc = ns2_vc_alloc(bind, nse, true, NS2_VC_MODE_BLOCKRESET, idbuf);
+ nsvc = ns2_vc_alloc(bind, nse, true, GPRS_NS2_VC_MODE_BLOCKRESET, idbuf);
if (!nsvc)
goto err;
@@ -789,7 +789,7 @@ struct gprs_ns2_vc *gprs_ns2_fr_connect2(struct gprs_ns2_vc_bind *bind,
OSMO_ASSERT(gprs_ns2_is_fr_bind(bind));
nse = gprs_ns2_nse_by_nsei(bind->nsi, nsei);
if (!nse) {
- nse = gprs_ns2_create_nse(bind->nsi, nsei, GPRS_NS2_LL_FR, NS2_DIALECT_STATIC_RESETBLOCK);
+ nse = gprs_ns2_create_nse(bind->nsi, nsei, GPRS_NS2_LL_FR, GPRS_NS2_DIALECT_STATIC_RESETBLOCK);
if (!nse)
return NULL;
created_nse = true;
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 2dc6524a..427a153e 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -713,7 +713,7 @@ static void ns2_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state
/* on a generic failure, the timer callback will recover */
if (old_state != GPRS_SNS_ST_UNCONFIGURED)
- ns2_prim_status_ind(gss->nse, NULL, 0, NS_AFF_CAUSE_SNS_FAILURE);
+ ns2_prim_status_ind(gss->nse, NULL, 0, GPRS_NS2_AFF_CAUSE_SNS_FAILURE);
ns2_clear_ipv46_entries(gss);
@@ -1265,7 +1265,7 @@ static void ns2_sns_st_configured(struct osmo_fsm_inst *fi, uint32_t event, void
static void ns2_sns_st_configured_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
{
struct gprs_ns2_nse *nse = nse_inst_from_fi(fi);
- ns2_prim_status_ind(nse, NULL, 0, NS_AFF_CAUSE_SNS_CONFIGURED);
+ ns2_prim_status_ind(nse, NULL, 0, GPRS_NS2_AFF_CAUSE_SNS_CONFIGURED);
}
static const struct osmo_fsm_state ns2_sns_bss_states[] = {
@@ -1369,7 +1369,7 @@ static void ns2_sns_st_all_action(struct osmo_fsm_inst *fi, uint32_t event, void
/* Choose the next sns endpoint. */
if (llist_empty(&gss->sns_endpoints)) {
gss->initial = NULL;
- ns2_prim_status_ind(gss->nse, NULL, 0, NS_AFF_CAUSE_SNS_NO_ENDPOINTS);
+ ns2_prim_status_ind(gss->nse, NULL, 0, GPRS_NS2_AFF_CAUSE_SNS_NO_ENDPOINTS);
osmo_fsm_inst_state_chg(fi, GPRS_SNS_ST_UNCONFIGURED, 0, 3);
return;
} else if (!gss->initial) {
@@ -1606,7 +1606,7 @@ int gprs_ns2_sns_add_endpoint(struct gprs_ns2_nse *nse,
return -EINVAL;
}
- if (nse->dialect != NS2_DIALECT_SNS) {
+ if (nse->dialect != GPRS_NS2_DIALECT_SNS) {
return -EINVAL;
}
@@ -1645,7 +1645,7 @@ int gprs_ns2_sns_del_endpoint(struct gprs_ns2_nse *nse,
return -EINVAL;
}
- if (nse->dialect != NS2_DIALECT_SNS) {
+ if (nse->dialect != GPRS_NS2_DIALECT_SNS) {
return -EINVAL;
}
@@ -1698,7 +1698,7 @@ int gprs_ns2_sns_count(struct gprs_ns2_nse *nse)
return -EINVAL;
}
- if (nse->dialect != NS2_DIALECT_SNS) {
+ if (nse->dialect != GPRS_NS2_DIALECT_SNS) {
return -EINVAL;
}
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index e1ffad6c..43ece136 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -488,7 +488,7 @@ bool gprs_ns2_ip_vc_equal(const struct gprs_ns2_vc *nsvc,
if (osmo_sockaddr_cmp(remote, &vpriv->remote))
return false;
- if (nsvc->mode == NS2_VC_MODE_BLOCKRESET)
+ if (nsvc->mode == GPRS_NS2_VC_MODE_BLOCKRESET)
if (nsvc->nsvci != nsvci)
return false;
diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index 7ee29a13..457a41f4 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -212,7 +212,7 @@ static void alive_timeout_handler(void *data)
osmo_timer_schedule(&priv->alive.timer, nsi->timeout[NS_TOUT_TNS_ALIVE], 0);
} else {
/* lost connection */
- if (priv->nsvc->mode == NS2_VC_MODE_BLOCKRESET) {
+ if (priv->nsvc->mode == GPRS_NS2_VC_MODE_BLOCKRESET) {
osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0);
} else {
osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_ALIVE, nsi->timeout[NS_TOUT_TNS_ALIVE], 0);
@@ -235,10 +235,10 @@ static void ns2_st_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *
switch (event) {
case GPRS_NS2_EV_REQ_START:
switch (priv->nsvc->mode) {
- case NS2_VC_MODE_ALIVE:
+ case GPRS_NS2_VC_MODE_ALIVE:
osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_ALIVE, nsi->timeout[NS_TOUT_TNS_ALIVE], NS_TOUT_TNS_ALIVE);
break;
- case NS2_VC_MODE_BLOCKRESET:
+ case GPRS_NS2_VC_MODE_BLOCKRESET:
osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], NS_TOUT_TNS_RESET);
break;
}
@@ -372,7 +372,7 @@ static void ns2_st_unblocked_on_enter(struct osmo_fsm_inst *fi, uint32_t old_sta
priv->accept_unitdata = true;
ns2_nse_notify_unblocked(nsvc, true);
- ns2_prim_status_ind(nse, nsvc, 0, NS_AFF_CAUSE_VC_RECOVERY);
+ ns2_prim_status_ind(nse, nsvc, 0, GPRS_NS2_AFF_CAUSE_VC_RECOVERY);
}
static void ns2_st_unblocked(struct osmo_fsm_inst *fi, uint32_t event, void *data)
@@ -551,9 +551,9 @@ static void ns2_recv_unitdata(struct osmo_fsm_inst *fi,
/* 10.3.9 NS SDU Control Bits */
if (nsh->data[0] & 0x1)
- nsp.u.unitdata.change = NS_ENDPOINT_REQUEST_CHANGE;
+ nsp.u.unitdata.change = GPRS_NS2_ENDPOINT_REQUEST_CHANGE;
- osmo_prim_init(&nsp.oph, SAP_NS, PRIM_NS_UNIT_DATA,
+ osmo_prim_init(&nsp.oph, SAP_NS, GPRS_NS2_PRIM_UNIT_DATA,
PRIM_OP_INDICATION, msg);
nsi->cb(&nsp.oph, nsi->cb_data);
}
@@ -568,7 +568,7 @@ static void ns2_vc_fsm_allstate_action(struct osmo_fsm_inst *fi,
switch (event) {
case GPRS_NS2_EV_RX_RESET:
- if (priv->nsvc->mode != NS2_VC_MODE_BLOCKRESET)
+ if (priv->nsvc->mode != GPRS_NS2_VC_MODE_BLOCKRESET)
break;
/* move the FSM into reset */
diff --git a/src/gb/gprs_ns2_vty.c b/src/gb/gprs_ns2_vty.c
index d6674ff8..f8036551 100644
--- a/src/gb/gprs_ns2_vty.c
+++ b/src/gb/gprs_ns2_vty.c
@@ -212,7 +212,7 @@ static int config_write_ns(struct vty *vty)
priv.dscp, VTY_NEWLINE);
vty_out(vty, " encapsulation udp use-reset-block-unblock %s%s",
- priv.vc_mode == NS2_VC_MODE_BLOCKRESET ? "enabled" : "disabled", VTY_NEWLINE);
+ priv.vc_mode == GPRS_NS2_VC_MODE_BLOCKRESET ? "enabled" : "disabled", VTY_NEWLINE);
llist_for_each_entry(vtyvc, &priv.vtyvc, list) {
vty_out(vty, " nse %u nsvci %u%s",
@@ -440,7 +440,7 @@ DEFUN_HIDDEN(nsvc_force_unconf, nsvc_force_unconf_cmd,
return CMD_WARNING;
}
- if (nse->dialect == NS2_DIALECT_SNS) {
+ if (nse->dialect == GPRS_NS2_DIALECT_SNS) {
gprs_ns2_free_nsvcs(nse);
} else {
/* Perform the operation for all nsvc */
@@ -718,9 +718,9 @@ DEFUN(cfg_nsip_res_block_unblock, cfg_nsip_res_block_unblock_cmd,
enum gprs_ns2_vc_mode vc_mode;
if (!strcmp(argv[0], "enabled"))
- vc_mode = NS2_VC_MODE_BLOCKRESET;
+ vc_mode = GPRS_NS2_VC_MODE_BLOCKRESET;
else
- vc_mode = NS2_VC_MODE_ALIVE;
+ vc_mode = GPRS_NS2_VC_MODE_ALIVE;
priv.vc_mode = vc_mode;
@@ -831,7 +831,7 @@ int gprs_ns2_vty_init(struct gprs_ns2_inst *nsi,
vty_nsi = nsi;
memset(&priv, 0, sizeof(struct ns2_vty_priv));
INIT_LLIST_HEAD(&priv.vtyvc);
- priv.vc_mode = NS2_VC_MODE_BLOCKRESET;
+ priv.vc_mode = GPRS_NS2_VC_MODE_BLOCKRESET;
if (default_bind)
memcpy(&priv.udp, default_bind, sizeof(*default_bind));
@@ -888,7 +888,7 @@ int gprs_ns2_vty_create() {
struct gprs_ns2_nse *nse;
struct gprs_ns2_vc *nsvc;
struct osmo_sockaddr sockaddr;
- enum gprs_ns2_dialect dialect = NS2_DIALECT_UNDEF;
+ enum gprs_ns2_dialect dialect = GPRS_NS2_DIALECT_UNDEF;
int rc = 0;
if (!vty_nsi)
@@ -906,7 +906,7 @@ int gprs_ns2_vty_create() {
return -1;
}
- bind->accept_ipaccess = priv.vc_mode == NS2_VC_MODE_BLOCKRESET;
+ bind->accept_ipaccess = priv.vc_mode == GPRS_NS2_VC_MODE_BLOCKRESET;
}
/* create vcs */
@@ -914,10 +914,10 @@ int gprs_ns2_vty_create() {
/* validate settings */
switch (vtyvc->ll) {
case GPRS_NS2_LL_UDP:
- if (priv.vc_mode == NS2_VC_MODE_BLOCKRESET)
- dialect = NS2_DIALECT_IPACCESS;
+ if (priv.vc_mode == GPRS_NS2_VC_MODE_BLOCKRESET)
+ dialect = GPRS_NS2_DIALECT_IPACCESS;
else
- dialect = NS2_DIALECT_STATIC_ALIVE;
+ dialect = GPRS_NS2_DIALECT_STATIC_ALIVE;
if (strlen(vtyvc->remote.ip) == 0) {
/* Invalid IP for VC */
continue;
@@ -934,10 +934,10 @@ int gprs_ns2_vty_create() {
}
break;
case GPRS_NS2_LL_FR:
- dialect = NS2_DIALECT_STATIC_RESETBLOCK;
+ dialect = GPRS_NS2_DIALECT_STATIC_RESETBLOCK;
break;
case GPRS_NS2_LL_FR_GRE:
- dialect = NS2_DIALECT_STATIC_RESETBLOCK;
+ dialect = GPRS_NS2_DIALECT_STATIC_RESETBLOCK;
continue;
case GPRS_NS2_LL_UNDEF:
/* should not happen */
diff --git a/src/gb/gprs_ns2_vty2.c b/src/gb/gprs_ns2_vty2.c
index 43dd2631..31aff3e3 100644
--- a/src/gb/gprs_ns2_vty2.c
+++ b/src/gb/gprs_ns2_vty2.c
@@ -171,7 +171,7 @@ DEFUN(cfg_ns_nsei, cfg_ns_nsei_cmd,
nse = gprs_ns2_nse_by_nsei(vty_nsi, nsei);
if (!nse) {
- nse = gprs_ns2_create_nse(vty_nsi, nsei, GPRS_NS2_LL_UNDEF, NS2_DIALECT_UNDEF);
+ nse = gprs_ns2_create_nse(vty_nsi, nsei, GPRS_NS2_LL_UNDEF, GPRS_NS2_DIALECT_UNDEF);
if (!nse) {
vty_out(vty, "Failed to create NSE!%s", VTY_NEWLINE);
return CMD_ERR_INCOMPLETE;
@@ -345,7 +345,7 @@ static void config_write_nsvc(struct vty *vty, const struct gprs_ns2_vc *nsvc)
break;
case GPRS_NS2_LL_UDP:
switch (nsvc->nse->dialect) {
- case NS2_DIALECT_IPACCESS:
+ case GPRS_NS2_DIALECT_IPACCESS:
addr = gprs_ns2_ip_vc_remote(nsvc);
if (!addr)
break;
@@ -355,7 +355,7 @@ static void config_write_nsvc(struct vty *vty, const struct gprs_ns2_vc *nsvc)
nsvc->bind->name, addr_str.ip, addr_str.port,
nsvc->nsvci, VTY_NEWLINE);
break;
- case NS2_DIALECT_STATIC_ALIVE:
+ case GPRS_NS2_DIALECT_STATIC_ALIVE:
addr = gprs_ns2_ip_vc_remote(nsvc);
if (!addr)
break;
@@ -390,7 +390,7 @@ static void _config_write_ns_nse(struct vty *vty, struct gprs_ns2_nse *nse)
vty_out(vty, " nse %u%s", nse->nsei, VTY_NEWLINE);
switch (nse->dialect) {
- case NS2_DIALECT_SNS:
+ case GPRS_NS2_DIALECT_SNS:
ns2_sns_write_vty(vty, nse);
break;
default:
@@ -709,7 +709,7 @@ DEFUN(cfg_ns_nse_nsvc_fr, cfg_ns_nse_nsvc_fr_cmd,
goto err;
}
- if (nse->dialect != NS2_DIALECT_STATIC_RESETBLOCK && nse->dialect != NS2_DIALECT_UNDEF) {
+ if (nse->dialect != GPRS_NS2_DIALECT_STATIC_RESETBLOCK && nse->dialect != GPRS_NS2_DIALECT_UNDEF) {
vty_out(vty, "Can not mix NS-VC with different dialects%s", VTY_NEWLINE);
goto err;
}
@@ -719,8 +719,8 @@ DEFUN(cfg_ns_nse_nsvc_fr, cfg_ns_nse_nsvc_fr_cmd,
ll_modified = true;
}
- if (nse->dialect == NS2_DIALECT_UNDEF) {
- nse->dialect = NS2_DIALECT_STATIC_RESETBLOCK;
+ if (nse->dialect == GPRS_NS2_DIALECT_UNDEF) {
+ nse->dialect = GPRS_NS2_DIALECT_STATIC_RESETBLOCK;
dialect_modified = true;
}
@@ -755,7 +755,7 @@ err:
if (ll_modified)
nse->ll = GPRS_NS2_LL_UNDEF;
if (dialect_modified)
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
return CMD_WARNING;
}
@@ -806,7 +806,7 @@ DEFUN(cfg_no_ns_nse_nsvc_fr_dlci, cfg_no_ns_nse_nsvc_fr_dlci_cmd,
gprs_ns2_free_nsvc(nsvc);
if (llist_empty(&nse->nsvc)) {
nse->ll = GPRS_NS2_LL_UNDEF;
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
}
return CMD_SUCCESS;
@@ -825,15 +825,15 @@ DEFUN(cfg_no_ns_nse_nsvci, cfg_no_ns_nse_nsvci_cmd,
uint16_t nsvci = atoi(argv[0]);
switch (nse->dialect) {
- case NS2_DIALECT_SNS:
- case NS2_DIALECT_STATIC_ALIVE:
+ case GPRS_NS2_DIALECT_SNS:
+ case GPRS_NS2_DIALECT_STATIC_ALIVE:
vty_out(vty, "NSE doesn't support NSVCI.%s", VTY_NEWLINE);
return CMD_WARNING;
- case NS2_DIALECT_UNDEF:
+ case GPRS_NS2_DIALECT_UNDEF:
vty_out(vty, "No NSVCs configured%s", VTY_NEWLINE);
return CMD_WARNING;
- case NS2_DIALECT_IPACCESS:
- case NS2_DIALECT_STATIC_RESETBLOCK:
+ case GPRS_NS2_DIALECT_IPACCESS:
+ case GPRS_NS2_DIALECT_STATIC_RESETBLOCK:
break;
}
@@ -852,7 +852,7 @@ DEFUN(cfg_no_ns_nse_nsvci, cfg_no_ns_nse_nsvci_cmd,
gprs_ns2_free_nsvc(nsvc);
if (llist_empty(&nse->nsvc)) {
nse->ll = GPRS_NS2_LL_UNDEF;
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
}
return CMD_SUCCESS;
@@ -883,8 +883,8 @@ DEFUN(cfg_ns_nse_nsvc_udp, cfg_ns_nse_nsvc_udp_cmd,
ll_modified = true;
}
- if (nse->dialect == NS2_DIALECT_UNDEF) {
- nse->dialect = NS2_DIALECT_STATIC_ALIVE;
+ if (nse->dialect == GPRS_NS2_DIALECT_UNDEF) {
+ nse->dialect = GPRS_NS2_DIALECT_STATIC_ALIVE;
dialect_modified = true;
}
@@ -893,7 +893,7 @@ DEFUN(cfg_ns_nse_nsvc_udp, cfg_ns_nse_nsvc_udp_cmd,
goto err;
}
- if (nse->dialect != NS2_DIALECT_STATIC_ALIVE) {
+ if (nse->dialect != GPRS_NS2_DIALECT_STATIC_ALIVE) {
vty_out(vty, "Can not mix NS-VC with different dialects%s", VTY_NEWLINE);
goto err;
}
@@ -934,7 +934,7 @@ err:
if (ll_modified)
nse->ll = GPRS_NS2_LL_UNDEF;
if (dialect_modified)
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
return CMD_WARNING;
}
@@ -961,7 +961,7 @@ DEFUN(cfg_no_ns_nse_nsvc_udp, cfg_no_ns_nse_nsvc_udp_cmd,
return CMD_WARNING;
}
- if (nse->dialect != NS2_DIALECT_STATIC_ALIVE) {
+ if (nse->dialect != GPRS_NS2_DIALECT_STATIC_ALIVE) {
vty_out(vty, "This NSE doesn't support UDP with dialect static alive.%s", VTY_NEWLINE);
return CMD_WARNING;
}
@@ -1010,7 +1010,7 @@ DEFUN(cfg_no_ns_nse_nsvc_udp, cfg_no_ns_nse_nsvc_udp_cmd,
gprs_ns2_free_nsvc(nsvc);
if (llist_empty(&nse->nsvc)) {
nse->ll = GPRS_NS2_LL_UNDEF;
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
}
return CMD_SUCCESS;
@@ -1044,8 +1044,8 @@ DEFUN(cfg_ns_nse_nsvc_ipa, cfg_ns_nse_nsvc_ipa_cmd,
ll_modified = true;
}
- if (nse->dialect == NS2_DIALECT_UNDEF) {
- nse->dialect = NS2_DIALECT_IPACCESS;
+ if (nse->dialect == GPRS_NS2_DIALECT_UNDEF) {
+ nse->dialect = GPRS_NS2_DIALECT_IPACCESS;
dialect_modified = true;
}
@@ -1054,7 +1054,7 @@ DEFUN(cfg_ns_nse_nsvc_ipa, cfg_ns_nse_nsvc_ipa_cmd,
goto err;
}
- if (nse->dialect != NS2_DIALECT_IPACCESS) {
+ if (nse->dialect != GPRS_NS2_DIALECT_IPACCESS) {
vty_out(vty, "Can not mix NS-VC with different dialects%s", VTY_NEWLINE);
goto err;
}
@@ -1095,7 +1095,7 @@ err:
if (ll_modified)
nse->ll = GPRS_NS2_LL_UNDEF;
if (dialect_modified)
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
return CMD_WARNING;
}
@@ -1125,7 +1125,7 @@ DEFUN(cfg_no_ns_nse_nsvc_ipa, cfg_no_ns_nse_nsvc_ipa_cmd,
return CMD_WARNING;
}
- if (nse->dialect != NS2_DIALECT_IPACCESS) {
+ if (nse->dialect != GPRS_NS2_DIALECT_IPACCESS) {
vty_out(vty, "This NSE doesn't support UDP with dialect ipaccess.%s", VTY_NEWLINE);
return CMD_WARNING;
}
@@ -1185,7 +1185,7 @@ DEFUN(cfg_no_ns_nse_nsvc_ipa, cfg_no_ns_nse_nsvc_ipa_cmd,
gprs_ns2_free_nsvc(nsvc);
if (llist_empty(&nse->nsvc)) {
nse->ll = GPRS_NS2_LL_UNDEF;
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
}
return CMD_SUCCESS;
@@ -1213,13 +1213,13 @@ DEFUN(cfg_ns_nse_ip_sns, cfg_ns_nse_ip_sns_cmd,
ll_modified = true;
}
- if (nse->dialect == NS2_DIALECT_UNDEF) {
+ if (nse->dialect == GPRS_NS2_DIALECT_UNDEF) {
char sns[16];
snprintf(sns, sizeof(sns), "NSE%05u-SNS", nse->nsei);
nse->bss_sns_fi = ns2_sns_bss_fsm_alloc(nse, sns);
if (!nse->bss_sns_fi)
goto err;
- nse->dialect = NS2_DIALECT_SNS;
+ nse->dialect = GPRS_NS2_DIALECT_SNS;
dialect_modified = true;
}
@@ -1228,7 +1228,7 @@ DEFUN(cfg_ns_nse_ip_sns, cfg_ns_nse_ip_sns_cmd,
goto err;
}
- if (nse->dialect != NS2_DIALECT_SNS) {
+ if (nse->dialect != GPRS_NS2_DIALECT_SNS) {
vty_out(vty, "Can not mix NS-VC with different dialects%s", VTY_NEWLINE);
goto err;
}
@@ -1259,7 +1259,7 @@ err:
if (ll_modified)
nse->ll = GPRS_NS2_LL_UNDEF;
if (dialect_modified)
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
return CMD_WARNING;
}
@@ -1282,7 +1282,7 @@ DEFUN(cfg_no_ns_nse_ip_sns, cfg_no_ns_nse_ip_sns_cmd,
return CMD_WARNING;
}
- if (nse->dialect != NS2_DIALECT_SNS) {
+ if (nse->dialect != GPRS_NS2_DIALECT_SNS) {
vty_out(vty, "This NSE doesn't support UDP with dialect ip-sns.%s", VTY_NEWLINE);
return CMD_WARNING;
}
@@ -1313,7 +1313,7 @@ DEFUN(cfg_no_ns_nse_ip_sns, cfg_no_ns_nse_ip_sns_cmd,
osmo_fsm_inst_term(nse->bss_sns_fi, OSMO_FSM_TERM_REQUEST, NULL);
nse->bss_sns_fi = NULL;
nse->ll = GPRS_NS2_LL_UNDEF;
- nse->dialect = NS2_DIALECT_UNDEF;
+ nse->dialect = GPRS_NS2_DIALECT_UNDEF;
}
return CMD_SUCCESS;
@@ -1493,7 +1493,7 @@ DEFUN_HIDDEN(nsvc_force_unconf, nsvc_force_unconf_cmd,
if (!nse->persistent) {
gprs_ns2_free_nse(nse);
- } else if (nse->dialect == NS2_DIALECT_SNS) {
+ } else if (nse->dialect == GPRS_NS2_DIALECT_SNS) {
gprs_ns2_free_nsvcs(nse);
} else {
/* Perform the operation for all nsvc */