libosmo-netif
0.2.0-dirty
Osmocom network interface library
|
00001 #ifndef _OSMO_NETIF_IPA_H_ 00002 #define _OSMO_NETIF_IPA_H_ 00003 00004 #include <osmocom/gsm/protocol/ipaccess.h> 00005 #include <osmocom/gsm/ipa.h> 00006 00007 /* This is like 'struct ipaccess_head' in libosmocore, but 'ipa_head' is 00008 * actually the more apropriate name, so rather than making more code 00009 * use the wrong name, let's keep the duplicate header definitions below */ 00010 struct ipa_head { 00011 uint16_t len; /* network byte order */ 00012 uint8_t proto; 00013 uint8_t data[0]; 00014 } __attribute__ ((packed)); 00015 00016 struct ipa_head_ext { 00017 uint8_t proto; 00018 uint8_t data[0]; 00019 } __attribute__ ((packed)); 00020 00021 struct msgb *osmo_ipa_msg_alloc(int headroom); 00022 void osmo_ipa_msg_push_header(struct msgb *msg, uint8_t proto); 00023 00024 int osmo_ipa_process_msg(struct msgb *msg); 00025 00026 struct osmo_fd; 00027 struct tlv_parsed; 00028 00029 int osmo_ipa_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd, int server); 00030 int osmo_ipa_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len); 00031 int osmo_ipa_parse_unitid(const char *str, struct ipaccess_unit *unit_data); 00032 00033 int ipaccess_send_pong(int fd); 00034 int ipaccess_send_id_ack(int fd); 00035 int ipaccess_send_id_req(int fd); 00036 00037 struct osmo_ipa_unit; 00038 00039 struct msgb *ipa_cli_id_resp(struct osmo_ipa_unit *dev, uint8_t *data, int len); 00040 struct msgb *ipa_cli_id_ack(void); 00041 00042 int osmo_ipa_parse_msg_id_resp(struct msgb *msg, struct ipaccess_unit *unit_data); 00043 00044 #endif