libosmo-netif  1.4.0
Osmocom network interface library
ipa.h
1 #ifndef _OSMO_NETIF_IPA_H_
2 #define _OSMO_NETIF_IPA_H_
3 
4 #include <osmocom/gsm/protocol/ipaccess.h>
5 #include <osmocom/gsm/ipa.h>
6 
7 /* This is like 'struct ipaccess_head' in libosmocore, but 'ipa_head' is
8  * actually the more apropriate name, so rather than making more code
9  * use the wrong name, let's keep the duplicate header definitions below */
10 struct ipa_head {
11  uint16_t len; /* network byte order */
12  uint8_t proto;
13  uint8_t data[0];
14 } __attribute__ ((packed));
15 
16 struct ipa_head_ext {
17  uint8_t proto;
18  uint8_t data[0];
19 } __attribute__ ((packed));
20 
22  uint8_t proto;
23  uint8_t proto_ext;
24 } __attribute__ ((packed));
25 
26 #define OSMO_IPA_MSGB_CB(__msg) ((struct osmo_ipa_msgb_cb *)&((__msg)->cb[0]))
27 #define osmo_ipa_msgb_cb_proto(__x) OSMO_IPA_MSGB_CB(__x)->proto
28 #define osmo_ipa_msgb_cb_proto_ext(__x) OSMO_IPA_MSGB_CB(__x)->proto_ext
29 
30 struct msgb *osmo_ipa_msg_alloc(int headroom);
31 struct msgb *osmo_ipa_ext_msg_alloc(size_t headroom);
32 
33 void osmo_ipa_msg_push_header(struct msgb *msg, uint8_t proto);
34 
35 int osmo_ipa_process_msg(struct msgb *msg);
36 
37 struct osmo_fd;
38 struct tlv_parsed;
39 
40 int osmo_ipa_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd, int server);
41 int osmo_ipa_parse_unitid(const char *str, struct ipaccess_unit *unit_data);
42 
43 int ipaccess_send_pong(int fd);
44 int ipaccess_send_id_ack(int fd);
45 int ipaccess_send_id_req(int fd);
46 
47 struct osmo_ipa_unit;
48 
49 struct msgb *ipa_cli_id_resp(struct osmo_ipa_unit *dev, uint8_t *data, int len);
50 struct msgb *ipa_cli_id_ack(void);
51 
52 int osmo_ipa_parse_msg_id_resp(struct msgb *msg, struct ipaccess_unit *unit_data);
53 
54 int osmo_ipa_segmentation_cb(struct msgb *msg);
55 
56 #endif
osmo_ipa_msgb_cb
Definition: ipa.h:21
osmo_ipa_unit
Definition: ipa_unit.c:27
ipa_head_ext
Definition: ipa.h:16
ipa_head
Definition: ipa.h:10