Move v5x_l2_mgmt and v51_le_provisioning to src/

New names are v5x_le_management and v5x_le_provisioning
This commit is contained in:
Andreas Eversberg 2022-12-16 18:57:05 +01:00
parent a6ca9ee14c
commit b1876d2757
5 changed files with 37 additions and 37 deletions

View File

@ -26,12 +26,12 @@
#include <osmocom/gsm/tlv.h>
#include "v5x_internal.h"
#include "v5x_l2_mgmt.h"
#include "v52_le_user_port_fsm.h"
#include "v5x_protocol.h"
#include "v5x_le_port_fsm.h"
#include "v5x_le_pstn_fsm.h"
#include "logging.h"
void v51_mgmt_init(void)
void v5x_le_mgmt_init(void)
{
LOGP(DV5MGMT, LOGL_NOTICE, "Using V5x management\n");
}
@ -46,9 +46,9 @@ void v5x_mph_rcv_le(struct v5x_user_port *v5up, uint8_t prim, uint8_t *data, int
if (length && *data == PH_CTRL_UNBLOCK) {
LOGP(DV5MGMT, LOGL_INFO, "Received unblocking from LE of port %d.\n", v5up->nr);
v5up->le_unblocked = true;
v51_mph_snd(v5up, MPH_UBR);
v5x_mph_snd(v5up, MPH_UBR);
if (v5up->pstn.proto && v5up->an_unblocked)
v5x_pstn_mdu_snd(v5up, MDU_CTRL_port_unblocked);
v5x_le_pstn_mdu_snd(v5up, MDU_CTRL_port_unblocked);
if (!v5up->an_unblocked) {
LOGP(DV5MGMT, LOGL_INFO, "Reply with blocking, because AN is blocked.\n");
uint8_t ctrl = PH_CTRL_BLOCK;
@ -58,9 +58,9 @@ void v5x_mph_rcv_le(struct v5x_user_port *v5up, uint8_t prim, uint8_t *data, int
if (length && *data == PH_CTRL_BLOCK) {
LOGP(DV5MGMT, LOGL_INFO, "Received blocking from LE of port %d.\n", v5up->nr);
v5up->le_unblocked = false;
v51_mph_snd(v5up, MPH_BI);
v5x_mph_snd(v5up, MPH_BI);
if (v5up->pstn.proto)
v5x_pstn_mdu_snd(v5up, MDU_CTRL_port_blocked);
v5x_le_pstn_mdu_snd(v5up, MDU_CTRL_port_blocked);
}
break;
case PH_PRIM_ACT_REQ:
@ -69,11 +69,11 @@ void v5x_mph_rcv_le(struct v5x_user_port *v5up, uint8_t prim, uint8_t *data, int
ph_socket_tx_msg(s, 3, PH_PRIM_DACT_IND, NULL, 0);
break;
}
v51_mph_snd(v5up, MPH_AR);
v5x_mph_snd(v5up, MPH_AR);
break;
case PH_PRIM_DACT_REQ:
LOGP(DV5MGMT, LOGL_INFO, "Received deactivation from LE of port %d.\n", v5up->nr);
v51_mph_snd(v5up, MPH_DR);
v5x_mph_snd(v5up, MPH_DR);
break;
default:
LOGP(DV5MGMT, LOGL_INFO, "Received unknown prim %d from LE for port %d.\n", prim, v5up->nr);
@ -106,10 +106,10 @@ void v5x_mph_rcv_an(struct v5x_user_port *v5up, enum v5x_mph_prim prim, uint8_t
LOGP(DV5MGMT, LOGL_INFO, "Received unblocking request from AN of port %d.\n", v5up->nr);
if (v5up->le_unblocked) {
LOGP(DV5MGMT, LOGL_INFO, "Reply with unblocking request.\n");
v51_mph_snd(v5up, MPH_UBR);
v5x_mph_snd(v5up, MPH_UBR);
_block_unblock_socket(v5up, false);
if (v5up->pstn.proto)
v5x_pstn_mdu_snd(v5up, MDU_CTRL_port_unblocked);
v5x_le_pstn_mdu_snd(v5up, MDU_CTRL_port_unblocked);
} else
LOGP(DV5MGMT, LOGL_INFO, "Ignore unblocking request from AN, because LE is blocked.\n");
break;
@ -117,20 +117,20 @@ void v5x_mph_rcv_an(struct v5x_user_port *v5up, enum v5x_mph_prim prim, uint8_t
LOGP(DV5MGMT, LOGL_INFO, "Received unblocking indication from AN of port %d.\n", v5up->nr);
_block_unblock_socket(v5up, false);
if (v5up->pstn.proto)
v5x_pstn_mdu_snd(v5up, MDU_CTRL_port_unblocked);
v5x_le_pstn_mdu_snd(v5up, MDU_CTRL_port_unblocked);
break;
case MPH_BR:
LOGP(DV5MGMT, LOGL_INFO, "Received blocking request from AN of port %d.\n", v5up->nr);
v51_mph_snd(v5up, MPH_BI);
v5x_mph_snd(v5up, MPH_BI);
_block_unblock_socket(v5up, true);
if (v5up->pstn.proto)
v5x_pstn_mdu_snd(v5up, MDU_CTRL_port_blocked);
v5x_le_pstn_mdu_snd(v5up, MDU_CTRL_port_blocked);
break;
case MPH_BI:
LOGP(DV5MGMT, LOGL_INFO, "Received blocking indication from AN of port %d.\n", v5up->nr);
_block_unblock_socket(v5up, true);
if (v5up->pstn.proto)
v5x_pstn_mdu_snd(v5up, MDU_CTRL_port_blocked);
v5x_le_pstn_mdu_snd(v5up, MDU_CTRL_port_blocked);
break;
case MPH_AI:
LOGP(DV5MGMT, LOGL_INFO, "Received activation indication from AN of port %d.\n", v5up->nr);
@ -146,15 +146,15 @@ void v5x_mph_rcv_an(struct v5x_user_port *v5up, enum v5x_mph_prim prim, uint8_t
}
/* receive FE-message from NAT (PH-socket) and forward it to the PSTN protocol */
void v5x_fe_rcv_le(struct v5x_user_port *v5up, struct msgb *msg)
void v5x_nat_rcv_fe(struct v5x_user_port *v5up, struct msgb *msg)
{
enum v5x_fe_prim prim;
prim = *msg->data;
msgb_pull(msg, 1);
LOGP(DV5MGMT, LOGL_INFO, "MSG: NAT -> PSTN_LE\n");
v5x_pstn_fe_snd(v5up, prim, msg);
LOGP(DV5MGMT, LOGL_INFO, "FE message: NAT -> PSTN_LE of port %d.\n", v5up->nr);
v5x_le_pstn_fe_snd(v5up, prim, msg);
}
/* receive FE-message from PSTN protocol and forward it to NAT (PH-socket) */
@ -162,7 +162,7 @@ void v5x_pstn_rcv_fe(struct v5x_user_port *v5up, enum v5x_fe_prim prim, struct m
{
*msgb_push(msg, 1) = prim;
LOGP(DV5MGMT, LOGL_INFO, "MSG: PSTN_LE -> NAT\n");
LOGP(DV5MGMT, LOGL_INFO, "FE message: PSTN_LE -> NAT of port %d.\n", v5up->nr);
ph_socket_tx_msg(&v5up->ph_socket, 0, PH_PRIM_DATA_IND, msg->data, msg->len);
msgb_free(msg);

View File

@ -1,7 +1,7 @@
void v51_mgmt_init(void);
void v5x_le_mgmt_init(void);
void v5x_mph_rcv_le(struct v5x_user_port *v5up, uint8_t prim, uint8_t *data, int length);
void v5x_mph_rcv_an(struct v5x_user_port *v5up, enum v5x_mph_prim prim, uint8_t perf_grading);
void v5x_fe_rcv_le(struct v5x_user_port *v5up, struct msgb *msg);
void v5x_nat_rcv_fe(struct v5x_user_port *v5up, struct msgb *msg);
void v5x_pstn_rcv_fe(struct v5x_user_port *v5up, enum v5x_fe_prim prim, struct msgb *msg);
void v5x_pstn_rcv_mdu(struct v5x_user_port *v5up, enum v5x_mgmt_prim prim);

View File

@ -26,36 +26,36 @@
#include "v5x_internal.h"
#include "v5x_protocol.h"
#include "v51_le_provisioning.h"
#include "v51_le_ctrl.h"
#include "v5x_le_ctrl_fsm.h"
#include "v5x_le_provisioning.h"
#include "logging.h"
/* ITU-T G.964 Section 14.5 V5.1-re-provisioning procedures */
/* This is incomplete and very minimal */
void v51_provisioning_init(void)
void v5x_le_provisioning_init(void)
{
LOGP(DV5PROV, LOGL_NOTICE, "Using V5x provisioning\n");
}
/* messages from common control layer */
void v51_rcv_provisioning(struct v5x_interface *v5if, uint8_t cfi, uint8_t variant, uint8_t rej_cause,
void v5x_le_provisioning_rcv(struct v5x_interface *v5if, uint8_t cfi, uint8_t variant, uint8_t rej_cause,
uint32_t interface_id)
{
LOGP(DV5PROV, LOGL_DEBUG, "Received common control message from control protocol. "
"(cfi = %d, variant = %d, rej_cause = %d, interface_id = %d)\n", cfi, variant, rej_cause, interface_id);
switch (cfi) {
case V51_CTRL_ID_REQUEST_VARIANT_AND_INTERFACE_ID:
case V5X_CTRL_ID_REQUEST_VARIANT_AND_INTERFACE_ID:
LOGP(DV5PROV, LOGL_INFO, "AN requests variant and interface ID, replying.\n");
v51_snd_ctrl_common(v5if, V51_CTRL_ID_VARIANT_AND_INTERFACE_ID, NULL, &v5if->variant, &v5if->id);
v5x_le_ctrl_common_snd(v5if, V5X_CTRL_ID_VARIANT_AND_INTERFACE_ID, NULL, &v5if->variant, &v5if->id);
break;
case V51_CTRL_ID_RESTART_REQUEST:
case V5X_CTRL_ID_RESTART_REQUEST:
LOGP(DV5PROV, LOGL_INFO, "AN requests restart, replying.\n");
v51_snd_ctrl_common(v5if, V51_CTRL_ID_RESTART_COMPLETE, NULL, NULL, NULL);
v5x_le_ctrl_common_snd(v5if, V5X_CTRL_ID_RESTART_COMPLETE, NULL, NULL, NULL);
break;
case V51_CTRL_ID_VARIANT_AND_INTERFACE_ID:
case V5X_CTRL_ID_VARIANT_AND_INTERFACE_ID:
LOGP(DV5PROV, LOGL_INFO, "AN replies variant and interface ID. (variant = %d, interface_id = %d)\n",
variant, interface_id);
if (variant != v5if->variant)
@ -65,7 +65,7 @@ void v51_rcv_provisioning(struct v5x_interface *v5if, uint8_t cfi, uint8_t varia
v5if->variant);
}
break;
case V51_CTRL_ID_RESTART_COMPLETE:
case V5X_CTRL_ID_RESTART_COMPLETE:
LOGP(DV5PROV, LOGL_INFO, "AN replies restart.\n");
break;
default:
@ -74,11 +74,11 @@ void v51_rcv_provisioning(struct v5x_interface *v5if, uint8_t cfi, uint8_t varia
}
/* perform provisioning */
void v51_start_provisioning(struct v5x_interface *v5if)
void v5x_le_provisioning_start(struct v5x_interface *v5if)
{
/* ask for variant and interface ID */
LOGP(DV5PROV, LOGL_INFO, "Requesting variant and interface ID.\n");
v51_snd_ctrl_common(v5if, V51_CTRL_ID_REQUEST_VARIANT_AND_INTERFACE_ID, NULL, NULL, NULL);
v5x_le_ctrl_common_snd(v5if, V5X_CTRL_ID_REQUEST_VARIANT_AND_INTERFACE_ID, NULL, NULL, NULL);
#if 0
Do not send a restart, because it will make Fastlink reset the link after two minutes.

View File

@ -0,0 +1,4 @@
void v5x_le_provisioning_init(void);
void v5x_le_provisioning_rcv(struct v5x_interface *v5if, uint8_t cfi, uint8_t variant, uint8_t rej_cause, uint32_t interface_id);
void v5x_le_provisioning_start(struct v5x_interface *v5if);

View File

@ -1,4 +0,0 @@
void v51_provisioning_init(void);
void v51_rcv_provisioning(struct v5x_interface *v5if, uint8_t cfi, uint8_t variant, uint8_t rej_cause, uint32_t interface_id);
void v51_start_provisioning(struct v5x_interface *v5if);