Rename SAP functions of lapv5 to be more conclusive
This commit is contained in:
parent
7baab7b370
commit
ef5e67e3f0
26
lapv5.c
26
lapv5.c
|
@ -175,8 +175,8 @@ static void lapv5_sap_free(struct lapv5_sap *sap)
|
|||
talloc_free(sap);
|
||||
}
|
||||
|
||||
/* General input function for any data received for this LAPV5 instance */
|
||||
int lapv5_receive(struct lapv5_instance *li, struct msgb *msg, int *error)
|
||||
/* Receive Data (PH-DATA indication) on the given LAPD Instance */
|
||||
int lapv5_ph_data_ind(struct lapv5_instance *li, struct msgb *msg, int *error)
|
||||
{
|
||||
struct lapd_msg_ctx lctx;
|
||||
struct lapv5_sap *sap;
|
||||
|
@ -271,7 +271,7 @@ int lapv5_receive(struct lapv5_instance *li, struct msgb *msg, int *error)
|
|||
}
|
||||
|
||||
/* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
|
||||
int lapv5_sap_start(struct lapv5_instance *li, uint16_t dladdr)
|
||||
int lapv5_dl_est_req(struct lapv5_instance *li, uint16_t dladdr)
|
||||
{
|
||||
struct lapv5_sap *sap;
|
||||
struct osmo_dlsap_prim dp;
|
||||
|
@ -297,7 +297,7 @@ int lapv5_sap_start(struct lapv5_instance *li, uint16_t dladdr)
|
|||
}
|
||||
|
||||
/* Stop a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
|
||||
int lapv5_sap_stop(struct lapv5_instance *li, uint16_t dladdr)
|
||||
int lapv5_dl_rel_req(struct lapv5_instance *li, uint16_t dladdr)
|
||||
{
|
||||
struct lapv5_sap *sap;
|
||||
struct osmo_dlsap_prim dp;
|
||||
|
@ -319,7 +319,7 @@ int lapv5_sap_stop(struct lapv5_instance *li, uint16_t dladdr)
|
|||
}
|
||||
|
||||
/* Transmit Data (DL-DATA request) on the given LAPD Instance / DLADDR */
|
||||
void lapv5_transmit(struct lapv5_instance *li, uint8_t dladdr, struct msgb *msg)
|
||||
void lapv5_dl_data_req(struct lapv5_instance *li, uint8_t dladdr, struct msgb *msg)
|
||||
{
|
||||
struct lapv5_sap *sap;
|
||||
struct osmo_dlsap_prim dp;
|
||||
|
@ -376,7 +376,7 @@ static int send_ph_data_req(struct lapd_msg_ctx *lctx, struct msgb *msg)
|
|||
|
||||
/* forward frame to L1 */
|
||||
LOGDL(dl, LOGL_DEBUG, "TX: %s\n", osmo_hexdump(msg->data, msg->len));
|
||||
li->transmit_cb(msg, li->transmit_cbdata);
|
||||
li->ph_data_req_cb(msg, li->ph_data_req_cbdata);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -407,15 +407,15 @@ static int send_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
|
|||
;
|
||||
}
|
||||
|
||||
li->receive_cb(dp, dladdr, li->receive_cbdata);
|
||||
li->dl_receive_cb(dp, dladdr, li->dl_receive_cbdata);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Allocate a new LAPV5 instance */
|
||||
struct lapv5_instance *lapv5_instance_alloc(int network_side,
|
||||
void (*tx_cb)(struct msgb *msg, void *cbdata), void *tx_cbdata,
|
||||
void (*rx_cb)(struct osmo_dlsap_prim *odp, uint16_t dladdr, void *rx_cbdata), void *rx_cbdata,
|
||||
void (*ph_data_req_cb)(struct msgb *msg, void *cbdata), void *ph_data_req_cbdata,
|
||||
void (*dl_receive_cb)(struct osmo_dlsap_prim *odp, uint16_t dladdr, void *rx_cbdata), void *dl_receive_cbdata,
|
||||
const struct lapd_profile *profile, const char *name)
|
||||
{
|
||||
struct lapv5_instance *li;
|
||||
|
@ -425,10 +425,10 @@ struct lapv5_instance *lapv5_instance_alloc(int network_side,
|
|||
return NULL;
|
||||
|
||||
li->network_side = network_side;
|
||||
li->transmit_cb = tx_cb;
|
||||
li->transmit_cbdata = tx_cbdata;
|
||||
li->receive_cb = rx_cb;
|
||||
li->receive_cbdata = rx_cbdata;
|
||||
li->ph_data_req_cb = ph_data_req_cb;
|
||||
li->ph_data_req_cbdata = ph_data_req_cbdata;
|
||||
li->dl_receive_cb = dl_receive_cb;
|
||||
li->dl_receive_cbdata = dl_receive_cbdata;
|
||||
li->pcap_fd = -1;
|
||||
li->name = talloc_strdup(li, name);
|
||||
memcpy(&li->profile, profile, sizeof(li->profile));
|
||||
|
|
19
lapv5.h
19
lapv5.h
|
@ -6,10 +6,10 @@ struct lapv5_instance {
|
|||
struct llist_head list; /* list of LAPV5 instances */
|
||||
bool network_side;
|
||||
|
||||
void (*transmit_cb)(struct msgb *msg, void *cbdata);
|
||||
void *transmit_cbdata;
|
||||
void (*receive_cb)(struct osmo_dlsap_prim *odp, uint16_t dladdr, void *rx_cbdata);
|
||||
void *receive_cbdata;
|
||||
void (*ph_data_req_cb)(struct msgb *msg, void *cbdata);
|
||||
void *ph_data_req_cbdata;
|
||||
void (*dl_receive_cb)(struct osmo_dlsap_prim *odp, uint16_t dladdr, void *rx_cbdata);
|
||||
void *dl_receive_cbdata;
|
||||
|
||||
struct lapd_profile profile; /* must be a copy */
|
||||
|
||||
|
@ -19,3 +19,14 @@ struct lapv5_instance {
|
|||
};
|
||||
|
||||
int lapv5ef_rx(struct v5x_link *link, struct msgb *msg);
|
||||
|
||||
int lapv5_dl_est_req(struct lapv5_instance *li, uint16_t dladdr);
|
||||
int lapv5_dl_rel_req(struct lapv5_instance *li, uint16_t dladdr);
|
||||
void lapv5_dl_data_req(struct lapv5_instance *li, uint8_t dladdr, struct msgb *msg);
|
||||
|
||||
int lapv5_ph_data_ind(struct lapv5_instance *li, struct msgb *msg, int *error);
|
||||
|
||||
struct lapv5_instance *lapv5_instance_alloc(int network_side,
|
||||
void (*ph_data_req_cb)(struct msgb *msg, void *cbdata), void *ph_data_req_cbdata,
|
||||
void (*dl_receive_cb)(struct osmo_dlsap_prim *odp, uint16_t dladdr, void *rx_cbdata), void *dl_receive_cbdata,
|
||||
const struct lapd_profile *profile, const char *name);
|
||||
|
|
Loading…
Reference in New Issue