libosmogsm
0.11.0-dirty
Osmocom GSM library
|
IPA Multiplex utility routines. More...
Defines | |
#define | IPA_ALLOC_SIZE 1200 |
#define | IPA_STRING_MAX 64 |
Functions | |
const char * | ipa_ccm_idtag_name (uint8_t tag) |
int | ipa_ccm_idtag_parse (struct tlv_parsed *dec, unsigned char *buf, int len) |
int | ipa_ccm_idtag_parse_off (struct tlv_parsed *dec, unsigned char *buf, int len, const int len_offset) |
int | ipa_parse_unitid (const char *str, struct ipaccess_unit *unit_data) |
int | ipa_ccm_tlv_to_unitdata (struct ipaccess_unit *ud, const struct tlv_parsed *tp) |
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. | |
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 requets payload. | |
int | ipa_send (int fd, const void *msg, size_t msglen) |
int | ipa_ccm_send_pong (int fd) |
int | ipa_ccm_send_id_ack (int fd) |
int | ipa_ccm_send_id_req (int fd) |
int | ipa_ccm_rcvmsg_base (struct msgb *msg, struct osmo_fd *bfd) |
int | ipa_ccm_rcvmsg_bts_base (struct msgb *msg, struct osmo_fd *bfd) |
void | ipa_prepend_header_ext (struct msgb *msg, int proto) |
void | ipa_prepend_header (struct msgb *msg, int proto) |
struct msgb * | ipa_msg_alloc (int headroom) |
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 |
Referenced by ipa_ccm_make_id_resp().
const char* ipa_ccm_idtag_name | ( | uint8_t | tag | ) |
References ARRAY_SIZE, and idtag_names.
Referenced by ipa_ccm_idtag_parse_off().
int ipa_ccm_idtag_parse | ( | struct tlv_parsed * | dec, |
unsigned char * | buf, | ||
int | len | ||
) |
References ipa_ccm_idtag_parse_off().
int ipa_ccm_idtag_parse_off | ( | struct tlv_parsed * | dec, |
unsigned char * | buf, | ||
int | len, | ||
const int | len_offset | ||
) |
References DEBUGPC, DLMI, ipa_ccm_idtag_name(), tlv_p_entry::len, LOGL_ERROR, LOGP, tlv_parsed::lv, and tlv_p_entry::val.
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 | ||
) | [read] |
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 ipaccess_unit::bts_id, DLINP, ipaccess_unit::equipvers, 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, ipaccess_unit::location1, ipaccess_unit::location2, LOGL_INFO, LOGL_NOTICE, LOGP, ipaccess_unit::mac_addr, msgb_free(), msgb_put(), ipaccess_unit::serno, ipaccess_unit::site_id, ipaccess_unit::swversion, ipaccess_unit::trx_id, and ipaccess_unit::unit_name.
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 | ||
) | [read] |
Generate IPA CCM ID RESP based on requets 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 data, DLINP, ipa_ccm_make_id_resp(), LOGL_ERROR, and LOGP.
int ipa_ccm_rcvmsg_base | ( | struct msgb * | msg, |
struct osmo_fd * | bfd | ||
) |
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, msgb::l2h, LOGL_ERROR, LOGP, and msg_type.
int ipa_ccm_rcvmsg_bts_base | ( | struct msgb * | msg, |
struct osmo_fd * | bfd | ||
) |
References DEBUGP, DLINP, DLMI, osmo_fd::fd, ipa_ccm_send_pong(), IPAC_MSGT_ID_ACK, IPAC_MSGT_PING, IPAC_MSGT_PONG, msgb::l2h, LOGL_ERROR, LOGP, and msg_type.
int ipa_ccm_send_id_ack | ( | int | fd | ) |
References ipa_id_ack_msg, and ipa_send().
Referenced by ipa_ccm_rcvmsg_base().
int ipa_ccm_send_id_req | ( | int | fd | ) |
References ipa_id_req_msg, and ipa_send().
int ipa_ccm_send_pong | ( | int | fd | ) |
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 | ||
) |
References ipaccess_unit::equipvers, 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, ipaccess_unit::location1, ipaccess_unit::location2, ipaccess_unit::mac_addr, osmo_macaddr_parse(), ipaccess_unit::serno, ipaccess_unit::swversion, TLVP_PRES_LEN, TLVP_VAL, and ipaccess_unit::unit_name.
struct msgb* ipa_msg_alloc | ( | int | headroom | ) | [read] |
References msgb_alloc_headroom().
Referenced by ipa_ccm_make_id_resp().
int ipa_parse_unitid | ( | const char * | str, |
struct ipaccess_unit * | unit_data | ||
) |
References ipaccess_unit::bts_id, ipaccess_unit::site_id, and ipaccess_unit::trx_id.
Referenced by ipa_ccm_tlv_to_unitdata().
void ipa_prepend_header | ( | struct msgb * | msg, |
int | proto | ||
) |
References msgb::len, ipaccess_head::len, msgb_push(), osmo_htons, ipaccess_head::proto, and proto.
Referenced by ipa_ccm_make_id_resp().
void ipa_prepend_header_ext | ( | struct msgb * | msg, |
int | proto | ||
) |
References msgb_push(), proto, and ipaccess_head_ext::proto.
int ipa_send | ( | int | fd, |
const void * | msg, | ||
size_t | msglen | ||
) |
References DLINP, LOGL_ERROR, and LOGP.
Referenced by ipa_ccm_send_id_ack(), ipa_ccm_send_id_req(), and ipa_ccm_send_pong().
const char* idtag_names[] [static] |
{ [IPAC_IDTAG_SERNR] = "Serial_Number", [IPAC_IDTAG_UNITNAME] = "Unit_Name", [IPAC_IDTAG_LOCATION1] = "Location_1", [IPAC_IDTAG_LOCATION2] = "Location_2", [IPAC_IDTAG_EQUIPVERS] = "Equipment_Version", [IPAC_IDTAG_SWVERSION] = "Software_Version", [IPAC_IDTAG_IPADDR] = "IP_Address", [IPAC_IDTAG_MACADDR] = "MAC_Address", [IPAC_IDTAG_UNIT] = "Unit_ID", }
Referenced by ipa_ccm_idtag_name().
const uint8_t ipa_id_ack_msg[] [static] |
{ 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_ACK }
Referenced by ipa_ccm_send_id_ack().
const uint8_t ipa_id_req_msg[] [static] |
{ 0, 17, IPAC_PROTO_IPACCESS, IPAC_MSGT_ID_GET, 0x01, IPAC_IDTAG_UNIT, 0x01, IPAC_IDTAG_MACADDR, 0x01, IPAC_IDTAG_LOCATION1, 0x01, IPAC_IDTAG_LOCATION2, 0x01, IPAC_IDTAG_EQUIPVERS, 0x01, IPAC_IDTAG_SWVERSION, 0x01, IPAC_IDTAG_UNITNAME, 0x01, IPAC_IDTAG_SERNR, }
Referenced by ipa_ccm_send_id_req().
const uint8_t ipa_pong_msg[] [static] |
{ 0, 1, IPAC_PROTO_IPACCESS, IPAC_MSGT_PONG }
Referenced by ipa_ccm_send_pong().