Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 1 | #ifndef _IPACCESS_H |
| 2 | #define _IPACCESS_H |
| 3 | |
| 4 | #include "e1_input.h" |
| 5 | #include "gsm_subscriber.h" |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 6 | #include <osmocom/core/linuxlist.h> |
| 7 | #include <osmocom/gsm/protocol/ipaccess.h> |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 8 | |
| 9 | struct 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 Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 17 | /* |
| 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 | */ |
| 22 | struct 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 Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 29 | int ipaccess_connect(struct e1inp_line *line, struct sockaddr_in *sa); |
| 30 | |
| 31 | /* |
| 32 | * methods for parsing and sending a message |
| 33 | */ |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 34 | int ipaccess_rcvmsg_base(struct msgb *msg, struct osmo_fd *bfd); |
| 35 | struct msgb *ipaccess_read_msg(struct osmo_fd *bfd, int *error); |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 36 | void ipaccess_prepend_header(struct msgb *msg, int proto); |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 37 | void ipaccess_prepend_header_ext(struct msgb *msg, int proto); |
| 38 | int ipaccess_send_pong(int fd); |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 39 | int ipaccess_send_id_ack(int fd); |
| 40 | int ipaccess_send_id_req(int fd); |
| 41 | |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 42 | const char *ipaccess_idtag_name(uint8_t tag); |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 43 | int ipaccess_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len); |
Jonathan Santos | 5a45b15 | 2011-08-17 15:33:57 -0400 | [diff] [blame^] | 44 | int ipaccess_parse_unitid(const char *str, uint16_t *site_id, uint16_t *bts_id, uint16_t *trx_id); |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 45 | |
| 46 | int ipaccess_drop_oml(struct gsm_bts *bts); |
| 47 | int ipaccess_drop_rsl(struct gsm_bts_trx *trx); |
| 48 | |
Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 49 | struct sdp_header_item { |
| 50 | struct sdp_header_entry header_entry; |
| 51 | struct llist_head entry; |
| 52 | off_t absolute_offset; |
| 53 | }; |
| 54 | |
| 55 | struct 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 | |
| 65 | int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned base_offset, struct llist_head *list); |
| 66 | |
| 67 | #endif /* _IPACCESS_H */ |