blob: c2ca2a53003c1200063b2b1bbd175d5f08e60416 [file] [log] [blame]
Jonathan Santos03fd8d02011-05-25 13:54:02 -04001#ifndef _IPACCESS_H
2#define _IPACCESS_H
3
4#include "e1_input.h"
5#include "gsm_subscriber.h"
Jonathan Santos5a45b152011-08-17 15:33:57 -04006#include <osmocom/core/linuxlist.h>
7#include <osmocom/gsm/protocol/ipaccess.h>
Jonathan Santos03fd8d02011-05-25 13:54:02 -04008
9struct ipac_msgt_sccp_state {
10 uint8_t src_ref[3];
11 uint8_t dst_ref[3];
12 uint8_t trans_id;
13 uint8_t invoke_id;
14 char imsi[GSM_IMSI_LENGTH];
15} __attribute__((packed));
16
Jonathan Santos5a45b152011-08-17 15:33:57 -040017/*
18 * @add_remove 0 for remove, 1 for add, 3 to asK
19 * @nr_lacs Number of extra lacs inside this package
20 * @lac One lac entry
21 */
22struct ipac_ext_lac_cmd {
23 uint8_t add_remove;
24 uint8_t nr_extra_lacs;
25 uint16_t lac;
26 uint8_t data[0];
27} __attribute__((packed));
28
Jonathan Santos03fd8d02011-05-25 13:54:02 -040029int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa);
30
31/*
32 * methods for parsing and sending a message
33 */
Jonathan Santos5a45b152011-08-17 15:33:57 -040034int ipaccess_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd);
35struct msgb *ipaccess_read_msg(struct osmo_fd *bfd, int *error);
Jonathan Santos03fd8d02011-05-25 13:54:02 -040036void ipaccess_prepend_header(struct msgb *msg, int proto);
Jonathan Santos5a45b152011-08-17 15:33:57 -040037void ipaccess_prepend_header_ext(struct msgb *msg, int proto);
38int ipaccess_send_pong(int fd);
Jonathan Santos03fd8d02011-05-25 13:54:02 -040039int ipaccess_send_id_ack(int fd);
40int ipaccess_send_id_req(int fd);
41
Jonathan Santos5a45b152011-08-17 15:33:57 -040042const char *ipaccess_idtag_name(uint8_t tag);
Jonathan Santos03fd8d02011-05-25 13:54:02 -040043int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len);
Jonathan Santos5a45b152011-08-17 15:33:57 -040044int ipaccess_parse_unitid(const char *str, uint16_t *site_id, uint16_t *bts_id, uint16_t *trx_id);
Jonathan Santos03fd8d02011-05-25 13:54:02 -040045
46int ipaccess_drop_oml(struct gsm_bts *bts);
47int ipaccess_drop_rsl(struct gsm_bts_trx *trx);
48
Jonathan Santos03fd8d02011-05-25 13:54:02 -040049struct sdp_header_item {
50 struct sdp_header_entry header_entry;
51 struct llist_head entry;
52 off_t absolute_offset;
53};
54
55struct sdp_header {
56 struct sdp_firmware firmware_info;
57
58 /* for more_magic a list of sdp_header_entry_list */
59 struct llist_head header_list;
60
61 /* the entry of the sdp_header */
62 struct llist_head entry;
63};
64
65int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned base_offset, struct llist_head *list);
66
67#endif /* _IPACCESS_H */