libosmogsm 1.11.0.26-c59d.202505152026
Osmocom GSM library
|
IPA Multiplex utility routines. More...
Macros | |
#define | IPA_ALLOC_SIZE 1200 |
#define | IPA_STRING_MAX 64 |
Variables | |
static const uint8_t | ipa_pong_msg [] |
static const uint8_t | ipa_id_ack_msg [] |
static const uint8_t | ipa_id_req_msg [] |
static const char * | idtag_names [] |
IPA Multiplex utility routines.
#define IPA_ALLOC_SIZE 1200 |
#define IPA_STRING_MAX 64 |
Parse the payload part of an IPA CCM ID GET, return tlv_parsed format.
The odd payload format of those messages is structured as follows:
[out] | dec | Caller-provided/allocated output structure for parsed payload |
[in] | buf | Buffer containing the payload (excluding 1 byte msg_type) of the message |
[in] | len | Length of buf in octets |
References DLMI, ipa_ccm_idtag_name(), len, LOGL_DEBUG, LOGL_ERROR, LOGP, and LOGPC.
Parse the payload part of an IPA CCM ID RESP, return tlv_parsed format.
The odd payload format of those messages is structured as follows:
[out] | dec | Caller-provided/allocated output structure for parsed payload |
[in] | buf | Buffer containing the payload (excluding 1 byte msg_type) of the message |
[in] | len | Length of buf in octets |
References DEBUGPC, DLMI, ipa_ccm_idtag_name(), len, LOGL_DEBUG, LOGL_ERROR, LOGP, and LOGPC.
References ARRAY_SIZE, and idtag_names.
Referenced by ipa_ccm_id_get_parse(), ipa_ccm_id_resp_parse(), and ipa_ccm_idtag_parse_off().
Parse the payload part of an IPA CCM ID GET, return tlv_parsed format.
References ipa_ccm_idtag_parse_off(), and len.
int ipa_ccm_idtag_parse_off | ( | struct tlv_parsed * | dec, |
unsigned char * | buf, | ||
int | len, | ||
const int | len_offset | ||
) |
Parse the payload part of an IPA CCM ID GET, return tlv_parsed format.
WARNING: This function can only parse correctly IPA CCM ID GET/REQUEST messages, and only when len_offset is passed value of 1.
[out] | dec | Caller-provided/allocated output structure for parsed payload |
[in] | buf | Buffer containing the payload (excluding 1 byte msg_type) of the message |
[in] | len | Length of buf in octets |
[in] | len_offset | Offset from end of len field to start of value (ommiting tag). Must be 1! |
References DLMI, ipa_ccm_idtag_name(), len, LOGL_DEBUG, LOGL_ERROR, LOGP, and LOGPC.
Referenced by ipa_ccm_idtag_parse().
struct msgb * ipa_ccm_make_id_resp | ( | const struct ipaccess_unit * | dev, |
const uint8_t * | ies_req, | ||
unsigned int | num_ies_req | ||
) |
Generate IPA CCM ID RESP based on list of IEs.
[in] | dev | Descriptor describing identity data for response |
[in] | ies_req | List of IEIs to include in response |
[in] | num_ies_req | Number of IEIs in ies_req |
References DLINP, ipa_msg_alloc(), ipa_prepend_header(), IPA_STRING_MAX, IPAC_IDTAG_EQUIPVERS, IPAC_IDTAG_LOCATION1, IPAC_IDTAG_LOCATION2, IPAC_IDTAG_MACADDR, IPAC_IDTAG_SERNR, IPAC_IDTAG_SWVERSION, IPAC_IDTAG_UNIT, IPAC_IDTAG_UNITNAME, IPAC_MSGT_ID_RESP, IPAC_PROTO_IPACCESS, len, LOGL_INFO, LOGL_NOTICE, LOGP, msg, msgb_free(), and osmo_strlcpy().
Referenced by ipa_ccm_make_id_resp_from_req().
struct msgb * ipa_ccm_make_id_resp_from_req | ( | const struct ipaccess_unit * | dev, |
const uint8_t * | data, | ||
unsigned int | len | ||
) |
Generate IPA CCM ID RESP based on request payload.
[in] | dev | Descriptor describing identity data for response |
[in] | data | Payload of the IPA CCM ID GET request |
[in] | len | Length of data in octets |
References msgb::data, DLINP, ipa_ccm_make_id_resp(), len, LOGL_ERROR, and LOGP.
References DEBUGP, DLINP, DLMI, osmo_fd::fd, ipa_ccm_send_id_ack(), ipa_ccm_send_pong(), IPAC_MSGT_ID_ACK, IPAC_MSGT_PING, IPAC_MSGT_PONG, len, LOGL_ERROR, LOGP, msg, and msg_type.
References DEBUGP, DLINP, DLMI, osmo_fd::fd, ipa_ccm_send_pong(), IPAC_MSGT_ID_ACK, IPAC_MSGT_PING, IPAC_MSGT_PONG, len, LOGL_ERROR, LOGP, msg, and msg_type.
References ipa_id_ack_msg, and ipa_send().
Referenced by ipa_ccm_rcvmsg_base().
References ipa_id_req_msg, and ipa_send().
References ipa_pong_msg, and ipa_send().
Referenced by ipa_ccm_rcvmsg_base(), and ipa_ccm_rcvmsg_bts_base().
int ipa_ccm_tlv_to_unitdata | ( | struct ipaccess_unit * | ud, |
const struct tlv_parsed * | tp | ||
) |
Fill ud struct from tp structure.
[in,out] | ud | ipaccess_unit to fill |
[in] | tp | the decoded TLV structure from eg. ID_RESP message |
This function expects parameter ud's fields to be initialized to zero if not yet set. Existing incoming string pointer fields are expected to be allocated using talloc and will be deallocated as such if replaced with the content of tp.
References ipa_parse_unitid(), IPAC_IDTAG_EQUIPVERS, IPAC_IDTAG_LOCATION1, IPAC_IDTAG_LOCATION2, IPAC_IDTAG_MACADDR, IPAC_IDTAG_SERNR, IPAC_IDTAG_SWVERSION, IPAC_IDTAG_UNIT, IPAC_IDTAG_UNITNAME, len, osmo_macaddr_parse(), TLVP_PRES_LEN, and TLVP_VAL.
References len.
Referenced by ipa_ccm_make_id_resp().
int ipa_parse_unitid | ( | const char * | str, |
struct ipaccess_unit * | unit_data | ||
) |
References len.
Referenced by ipa_ccm_tlv_to_unitdata().
References len, ipaccess_head::len, msg, osmo_htons, and proto.
Referenced by ipa_ccm_make_id_resp().
References len, msg, proto, and ipaccess_head_ext::proto.
References DLINP, len, LOGL_ERROR, LOGP, and msg.
Referenced by ipa_ccm_send_id_ack(), ipa_ccm_send_id_req(), and ipa_ccm_send_pong().
Referenced by ipa_ccm_idtag_name().
Referenced by ipa_ccm_send_id_ack().
Referenced by ipa_ccm_send_id_req().
Referenced by ipa_ccm_send_pong().