diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/bsc_data.h | 100 | ||||
-rw-r--r-- | include/bsc_sccp.h | 10 | ||||
-rw-r--r-- | include/bsc_ussd.h | 6 | ||||
-rw-r--r-- | include/mtp_data.h | 2 |
4 files changed, 69 insertions, 49 deletions
diff --git a/include/bsc_data.h b/include/bsc_data.h index b0dc6f8..a72ea6a 100644 --- a/include/bsc_data.h +++ b/include/bsc_data.h @@ -40,6 +40,51 @@ struct bsc_data; struct snmp_mtp_session; +/** + * Struct holding the BSC to MSC forwarding state. + */ +struct bsc_msc_forward { + /* back pointer */ + struct bsc_data *bsc_data; + + /* the linkset we are using here */ + struct mtp_link_set *bsc; + + /* MSC */ + char *msc_address; + struct write_queue msc_connection; + struct timer_list reconnect_timer; + int first_contact; + int msc_time; + struct timer_list msc_timeout; + int msc_ip_dscp; + + int msc_link_down; + struct llist_head sccp_connections; + int reset_count; + + /* LAC of the cell */ + struct gsm48_loc_area_id lai; + uint16_t mcc; + uint16_t mnc; + uint16_t lac; + + const char *token; + + /* timeouts for the msc connection */ + int ping_time; + int pong_time; + struct timer_list ping_timeout; + struct timer_list pong_timeout; + struct timer_list reset_timeout; + + /* mgcp messgaes */ + struct write_queue mgcp_agent; + + /* do nothing with the data coming from the MSC */ + int forward_only; +}; + struct mtp_udp_data { struct write_queue write_queue; struct timer_list snmp_poll; @@ -74,39 +119,13 @@ enum { struct bsc_data { int app; - /* MSC */ - char *msc_address; - struct write_queue msc_connection; - struct timer_list reconnect_timer; - int first_contact; - int msc_time; - struct timer_list msc_timeout; - int msc_ip_dscp; - - int ping_time; - int pong_time; - struct timer_list ping_timeout; - struct timer_list pong_timeout; - - int msc_link_down; - struct llist_head sccp_connections; - struct timer_list reset_timeout; - int reset_count; - struct timer_list start_timer; - int setup; - int pcap_fd; int udp_reset_timeout; struct mtp_link_set *link_set; struct mtp_link_set *m2ua_set; - const char *token; - - /* mgcp messgaes */ - struct write_queue mgcp_agent; - /* udp code */ struct mtp_udp_data udp_data; @@ -127,37 +146,32 @@ struct bsc_data { /* isup handling */ int isup_pass; - /* LAC of the cell */ - struct gsm48_loc_area_id lai; - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - - int forward_only; /* inject */ int allow_inject; struct bsc_fd inject_fd; struct llist_head inject_list; + + /* MSC related data... currently only one is supported */ + struct bsc_msc_forward msc_forward; }; /* bsc related functions */ -void release_bsc_resources(struct bsc_data *bsc); +void release_bsc_resources(struct bsc_msc_forward *fw); void mtp_linkset_down(struct mtp_link_set *); void mtp_linkset_up(struct mtp_link_set *); /* msc related functions */ -int msc_init(struct bsc_data *bsc, int mgcp); -void msc_send_rlc(struct bsc_data *bsc, struct sccp_source_reference *src, struct sccp_source_reference *dest); -void msc_send_reset(struct bsc_data *bsc); -void msc_send_msg(struct bsc_data *bsc, int rc, struct sccp_parse_result *, struct msgb *msg); -void msc_send_direct(struct bsc_data *bsc, struct msgb *msg); -void msc_close_connection(struct bsc_data *data); +int msc_init(struct bsc_msc_forward *bsc, int mgcp); +void msc_send_rlc(struct bsc_msc_forward *bsc, struct sccp_source_reference *src, struct sccp_source_reference *dest); +void msc_send_reset(struct bsc_msc_forward *bsc); +void msc_send_msg(struct bsc_msc_forward *bsc, int rc, struct sccp_parse_result *, struct msgb *msg); +void msc_send_direct(struct bsc_msc_forward *bsc, struct msgb *msg); +void msc_close_connection(struct bsc_msc_forward *data); /* connection tracking and action */ -void update_con_state(struct mtp_link_set *link, int rc, struct sccp_parse_result *result, struct msgb *msg, int from_msc, int sls); -unsigned int sls_for_src_ref(struct sccp_source_reference *ref); +void update_con_state(struct bsc_msc_forward *fw, int rc, struct sccp_parse_result *result, struct msgb *msg, int from_msc, int sls); /* udp init */ int link_global_init(struct mtp_udp_data *data, int src_port); @@ -168,7 +182,7 @@ int link_reset_all(struct mtp_link_set *); int link_clear_all(struct mtp_link_set *); /* MGCP */ -void mgcp_forward(struct bsc_data *bsc, const uint8_t *data, unsigned int length); +void mgcp_forward(struct bsc_msc_forward *bsc, const uint8_t *data, unsigned int length); /* pcap */ enum { diff --git a/include/bsc_sccp.h b/include/bsc_sccp.h index 8811a2b..833257d 100644 --- a/include/bsc_sccp.h +++ b/include/bsc_sccp.h @@ -30,6 +30,8 @@ #include <osmocom/sccp/sccp.h> +struct bsc_msc_forward; + /* * One SCCP connection. * Use for connection tracking and fixups... @@ -61,10 +63,10 @@ struct active_sccp_con { }; void free_con(struct active_sccp_con *con); -struct active_sccp_con *find_con_by_dest_ref(struct sccp_source_reference *ref); -struct active_sccp_con *find_con_by_src_ref(struct sccp_source_reference *src_ref); -struct active_sccp_con *find_con_by_src_dest_ref(struct sccp_source_reference *src_ref, +struct active_sccp_con *find_con_by_dest_ref(struct bsc_msc_forward *, struct sccp_source_reference *ref); +struct active_sccp_con *find_con_by_src_ref(struct bsc_msc_forward *,struct sccp_source_reference *src_ref); +struct active_sccp_con *find_con_by_src_dest_ref(struct bsc_msc_forward *, struct sccp_source_reference *src_ref, struct sccp_source_reference *dst_ref); -unsigned int sls_for_src_ref(struct sccp_source_reference *ref); +unsigned int sls_for_src_ref(struct bsc_msc_forward *, struct sccp_source_reference *ref); #endif diff --git a/include/bsc_ussd.h b/include/bsc_ussd.h index ed61b65..988b7ab 100644 --- a/include/bsc_ussd.h +++ b/include/bsc_ussd.h @@ -21,8 +21,10 @@ #ifndef bsc_ussd_h #define bsc_ussd_h -int bsc_ussd_handle_out_msg(struct bsc_data *bsc, struct sccp_parse_result *result, struct msgb *msg); +struct bsc_msc_forward; -int bsc_ussd_handle_in_msg(struct bsc_data *bsc, struct sccp_parse_result *res, struct msgb *msg); +int bsc_ussd_handle_out_msg(struct bsc_msc_forward *, struct sccp_parse_result *result, struct msgb *msg); + +int bsc_ussd_handle_in_msg(struct bsc_msc_forward *, struct sccp_parse_result *res, struct msgb *msg); #endif diff --git a/include/mtp_data.h b/include/mtp_data.h index 9314962..1fa9277 100644 --- a/include/mtp_data.h +++ b/include/mtp_data.h @@ -25,6 +25,7 @@ #include <osmocore/utils.h> struct bsc_data; +struct bsc_msc_forward; struct mtp_link; struct mtp_level_3_mng *mng; struct rate_ctr_group; @@ -71,6 +72,7 @@ struct mtp_link_set { /* custom data */ struct bsc_data *bsc; + struct bsc_msc_forward *fw; }; /** |