#include <arpa/inet.h>#include "../../str.h"#include "../../ip_addr.h"#include "../../sr_module.h"#include "../tm/tm_load.h"#include "ha.h"#include "cluster.h"


Go to the source code of this file.
Data Structures | |
| struct | app_server |
| struct | as_entry |
| struct | as_msg |
| struct | cluster |
| struct | seas_functions |
Defines | |
| #define | AS_BUF_SIZE 4000 |
| #define | AS_TYPE 1 |
| #define | BIND_AC 6 |
| #define | CANCEL_FOUND 0x08 |
| #define | CLUSTER_TYPE 2 |
| #define | E2E_ACK 0x04 |
| #define | ENCODED_MSG_SIZE 3200 |
| #define | HAS_FD 1 |
| #define | HAS_NAME 2 |
| #define | MAX_AS_NAME 15 |
| #define | MAX_AS_NR 5 |
| #define | MAX_AS_PER_CLUSTER 10 |
| #define | MAX_BINDS 10 |
| #define | MAX_UNC_AS_NR 5 |
| #define | MAX_WHOAMI_LEN 30 |
| #define | net2hostL(dst, from, index) |
| #define | PING_AC 5 |
| #define | RES_IN 4 |
| #define | SL_REQ_IN 3 |
| #define | SPIRAL_FLAG 0x00000001 |
| #define | T_REQ_IN 2 |
| #define | UNBIND_AC 7 |
Typedefs | |
| typedef struct as_msg * | as_msg_p |
| typedef struct as_msg | as_msg_t |
| typedef struct app_server * | as_p |
| typedef struct app_server | as_t |
Functions | |
| char * | create_as_event_sl (struct sip_msg *msg, char processor_id, int *evt_len, int flags) |
| char * | create_as_event_t (struct cell *t, struct sip_msg *msg, char processor_id, int *evt_len, int flags) |
| char | get_processor_id (struct receive_info *rcv, as_p as) |
| static void | print_ip_buf (struct ip_addr *ip, char *where, int len) |
| void | seas_sighandler (int signo) |
Variables | |
| struct as_entry * | as_list |
| struct as_entry * | as_table |
| int | is_dispatcher |
| int | jain_ping |
| int | jain_pings_lost |
| struct as_entry * | my_as |
| int | read_pipe |
| struct seas_functions | seas_f |
| struct ip_addr * | seas_listen_ip |
| unsigned short | seas_listen_port |
| char | seas_sigchld_received |
| int | servlet_ping |
| int | servlet_pings_lost |
| char | use_stats |
| char | whoami [] |
| int | write_pipe |
| #define AS_BUF_SIZE 4000 |
Definition at line 44 of file seas.h.
Referenced by add_new_as(), dispatch_actions(), handle_as_data(), process_action(), process_event_reply(), and process_input().
| #define AS_TYPE 1 |
Definition at line 53 of file seas.h.
Referenced by add_new_as(), dispatcher_main_loop(), fixup_as_relay(), handle_as_data(), parse_cluster_cfg(), seas_sighandler(), spawn_pinger(), w_as_relay_sl(), and w_as_relay_t().
| #define BIND_AC 6 |
| #define CANCEL_FOUND 0x08 |
| #define CLUSTER_TYPE 2 |
Definition at line 54 of file seas.h.
Referenced by dispatch_relay(), dispatcher_main_loop(), parse_cluster_cfg(), w_as_relay_sl(), and w_as_relay_t().
| #define E2E_ACK 0x04 |
| #define ENCODED_MSG_SIZE 3200 |
Definition at line 46 of file seas.h.
Referenced by create_as_action_reply(), create_as_event_sl(), and create_as_event_t().
| #define HAS_FD 1 |
| #define HAS_NAME 2 |
| #define MAX_AS_NAME 15 |
| #define MAX_AS_PER_CLUSTER 10 |
| #define MAX_BINDS 10 |
Definition at line 41 of file seas.h.
Referenced by get_processor_id(), print_local_uri(), process_bind_action(), and process_unbind_action().
| #define MAX_UNC_AS_NR 5 |
Definition at line 33 of file seas.h.
Referenced by handle_unc_as_data(), new_as_connect(), and seas_init().
| #define MAX_WHOAMI_LEN 30 |
| #define net2hostL | ( | dst, | |||
| from, | |||||
| index | ) |
Value:
do{ \ memcpy(&(dst),(from)+(index),4); \ dst=ntohl(dst); \ (index)+=4; \ }while(0);
Definition at line 69 of file seas.h.
Referenced by ac_cancel(), ac_jain_pong(), ac_reply(), ac_sl_msg(), ac_uac_req(), process_bind_action(), and process_unbind_action().
| #define PING_AC 5 |
| #define RES_IN 4 |
| #define SL_REQ_IN 3 |
| #define SPIRAL_FLAG 0x00000001 |
ACTION identifiers
Definition at line 67 of file seas.h.
Referenced by ac_cancel(), and ac_uac_req().
| #define T_REQ_IN 2 |
ACTION identifiers
Definition at line 58 of file seas.h.
Referenced by create_as_event_t(), and w_as_relay_t().
| #define UNBIND_AC 7 |
| typedef struct app_server * as_p |
| typedef struct app_server as_t |
| char* create_as_event_sl | ( | struct sip_msg * | msg, | |
| char | processor_id, | |||
| int * | evt_len, | |||
| int | flags | |||
| ) |
creates an as_event in shared memory and returns its address or NULL if error. event_length(4) UNSIGNED INT includes the length 4 bytes itself type(1), processor_id(4), flags(4), transport(1). src_ip_len(1), src_ip(4 or 16), dst_ip_len(1), dst_ip(4 or 16), src_port(2), dst_port(2),
Definition at line 543 of file seas.c.
References receive_info::dst_ip, receive_info::dst_port, encode_msg(), ENCODED_MSG_SIZE, GET_PAY_SIZE, ip_addr::len, len, LM_ERR, NULL, port, receive_info::proto, sip_msg::rcv, shm_free, shm_malloc(), SL_REQ_IN, receive_info::src_ip, receive_info::src_port, and ip_addr::u.
Referenced by w_as_relay_sl(), and w_as_relay_t().
| char* create_as_event_t | ( | struct cell * | t, | |
| struct sip_msg * | msg, | |||
| char | processor_id, | |||
| int * | evt_len, | |||
| int | flags | |||
| ) |
creates an as_event in shared memory and returns its address or NULL if error. event_length(4) UNSIGNED INT includes the length 4 bytes itself type(1), flags(4), transport(1). src_ip_len(1), src_ip(4 or 16), dst_ip_len(1), dst_ip(4 or 16), src_port(2), dst_port(2), hash index(4), label(4), [cancelled hash_index,label]
seas_f.tmb.t_get_trans_ident(msg,&hash_index,&label); this is bad, because it ref-counts !!!
we dont even pass the unknown CANCEL to JAIN
Definition at line 422 of file seas.c.
References CANCEL_FOUND, receive_info::dst_ip, receive_info::dst_port, E2E_ACK, encode_msg(), ENCODED_MSG_SIZE, GET_PAY_SIZE, cell::hash_index, is_e2e_ack(), cell::label, ip_addr::len, len, LM_DBG, LM_ERR, LM_WARN, METHOD_CANCEL, NULL, port, receive_info::proto, sip_msg::rcv, seas_f, shm_free, shm_malloc(), receive_info::src_ip, receive_info::src_port, tm_binds::t_lookup_original_t, T_REQ_IN, T_UNDEFINED, seas_functions::tmb, and ip_addr::u.
Referenced by w_as_relay_t().
| char get_processor_id | ( | struct receive_info * | rcv, | |
| as_p | as | |||
| ) |
search within a given AS, if any of the registered processors is bound to the receive_info structure passed. If there is one, it returns its identifier (number between 0 and 128), otherwise it returns -1;
Definition at line 743 of file seas.c.
References ip_addr::addr, socket_info::address, ip_addr::af, app_server::binds, app_server::bound_processor, receive_info::dst_ip, ip_addr::len, MAX_BINDS, and ip_addr::u.
Referenced by w_as_relay_sl(), and w_as_relay_t().
| static void print_ip_buf | ( | struct ip_addr * | ip, | |
| char * | where, | |||
| int | len | |||
| ) | [inline, static] |
Definition at line 163 of file seas.h.
References ip_addr::addr, ip_addr::addr16, ip_addr::af, snprintf, and ip_addr::u.
Referenced by process_bind_action().
| void seas_sighandler | ( | int | signo | ) |
Sets up signal handlers
Definition at line 171 of file seas.c.
References app_server::ac_buffer, app_server::action_fd, app_server::action_pid, as_entry::as, AS_TYPE, as_entry::connected, is_dispatcher, LM_DBG, LM_INFO, my_as, as_entry::next, pkg_free, pkg_status, _str::s, sig_flag, as_entry::type, as_entry::u, and whoami.
Referenced by dispatcher_main_loop().
Definition at line 81 of file seas.c.
Referenced by add_new_as(), dispatcher_main_loop(), handle_as_data(), handle_unc_as_data(), parse_cluster_cfg(), and spawn_pinger().
| int is_dispatcher |
Definition at line 70 of file seas.c.
Referenced by dispatcher_main_loop(), seas_sighandler(), spawn_action_dispatcher(), and spawn_pinger().
| int jain_ping |
| int jain_pings_lost |
Definition at line 66 of file event_dispatcher.c.
Referenced by ac_cancel(), ac_uac_req(), as_action_fail_resp(), dispatch_actions(), process_input(), seas_sighandler(), and spawn_pinger().
| int read_pipe |
Definition at line 84 of file seas.c.
Referenced by dispatch_relay(), dispatcher_main_loop(), seas_child_init(), and seas_init().
| struct seas_functions seas_f |
Definition at line 86 of file seas.c.
Referenced by ac_cancel(), ac_reply(), ac_uac_req(), create_as_event_t(), seas_init(), uac_cb(), w_as_relay_sl(), and w_as_relay_t().
| struct ip_addr* seas_listen_ip |
| unsigned short seas_listen_port |
| int servlet_ping |
| char use_stats |
Definition at line 47 of file modules/seas/statistics.c.
Referenced by ac_reply(), dispatch_relay(), process_action(), process_input(), seas_init(), start_stats_server(), w_as_relay_sl(), and w_as_relay_t().
| char whoami[] |
Definition at line 69 of file seas.c.
Referenced by dispatch_actions(), dispatcher_main_loop(), seas_sighandler(), and spawn_pinger().
| int write_pipe |
Definition at line 83 of file seas.c.
Referenced by seas_init(), send_ping(), uac_cb(), w_as_relay_sl(), and w_as_relay_t().
1.5.6