📄 sipp.hpp
字号:
(DISPLAY_SCENARIO_SCREEN);extern int currentRepartitionToDisplay _DEFVAL(1);extern unsigned int base_cseq _DEFVAL(0);extern char * auth_uri _DEFVAL(0);extern char * call_id_string _DEFVAL("%u-%p@%s");extern char **generic[100];/* TDM map */extern bool use_tdmmap _DEFVAL(false);extern unsigned int tdm_map_a _DEFVAL(0);extern unsigned int tdm_map_b _DEFVAL(0);extern unsigned int tdm_map_c _DEFVAL(0);extern unsigned int tdm_map_x _DEFVAL(0);extern unsigned int tdm_map_y _DEFVAL(0);extern unsigned int tdm_map_z _DEFVAL(0);extern unsigned int tdm_map_h _DEFVAL(0);extern bool tdm_map[1024];#ifdef _USE_OPENSSLextern BIO *bio ;extern SSL *ssl_tcp_multiplex ;extern BIO *twinSipp_bio ;extern SSL *twinSipp_ssl ;extern char *tls_cert_name _DEFVAL(DEFAULT_TLS_CERT) ;extern char *tls_key_name _DEFVAL(DEFAULT_TLS_KEY) ;extern char *tls_crl_name _DEFVAL(DEFAULT_TLS_CRL) ;#endif// extern field file managementtypedef std::vector<std::string> IN_FILE_CONTENTS;extern IN_FILE_CONTENTS fileContents;extern int numLinesInFile _DEFVAL(0);extern int new_socket(bool P_use_ipv6, int P_type_socket, int * P_status);extern int delete_socket(int P_socket);extern int min_socket _DEFVAL(65535);extern int select_socket _DEFVAL(0);extern bool socket_close _DEFVAL(true);extern bool test_socket _DEFVAL(true);extern bool socket_open _DEFVAL(true);extern bool maxSocketPresent _DEFVAL(false);extern int *tab_multi_socket;extern unsigned int getmilliseconds();/************************ Statistics **************************/extern unsigned long total_calls _DEFVAL(0);extern unsigned long last_report_calls _DEFVAL(0);extern unsigned long nb_net_send_errors _DEFVAL(0);extern unsigned long nb_net_cong _DEFVAL(0);extern unsigned long nb_net_recv_errors _DEFVAL(0);extern bool cpu_max _DEFVAL(false);extern bool outbound_congestion _DEFVAL(false);extern int open_calls_peak _DEFVAL(0);extern unsigned long open_calls_peak_time _DEFVAL(0);extern int open_calls_user_setting _DEFVAL(0);extern int nb_out_of_the_blue _DEFVAL(0);extern int resynch_send _DEFVAL(0);extern int resynch_recv _DEFVAL(0);extern unsigned long rtp_pckts _DEFVAL(0);extern unsigned long rtp_bytes _DEFVAL(0);extern unsigned long rtp_pckts_pcap _DEFVAL(0);extern unsigned long rtp_bytes_pcap _DEFVAL(0);extern unsigned long rtp2_pckts _DEFVAL(0);extern unsigned long rtp2_bytes _DEFVAL(0);extern unsigned long rtp2_pckts_pcap _DEFVAL(0);extern unsigned long rtp2_bytes_pcap _DEFVAL(0);/************* Rate Control & Contexts variables **************/extern int open_calls _DEFVAL(0);extern int last_running_calls _DEFVAL(0);extern int last_woken_calls _DEFVAL(0);extern int last_paused_calls _DEFVAL(0);extern unsigned int open_calls_allowed _DEFVAL(0);extern unsigned long last_rate_change_time _DEFVAL(1);extern unsigned long last_report_time _DEFVAL(1);extern unsigned long last_dump_time _DEFVAL(1);extern unsigned long calls_since_last_rate_change _DEFVAL(0);/********************** Clock variables ***********************/extern unsigned long clock_tick _DEFVAL(1);extern unsigned long scheduling_loops _DEFVAL(0);extern unsigned long last_timer_cycle _DEFVAL(0);#define GET_TIME(clock) \{ \ struct timezone tzp; \ gettimeofday (clock, &tzp); \}/*********************** Global Sockets **********************/extern int main_socket _DEFVAL(0);extern int tcp_multiplex _DEFVAL(0);extern int media_socket _DEFVAL(0);extern int media_socket_video _DEFVAL(0);extern struct sockaddr_storage local_sockaddr;extern struct sockaddr_storage localTwin_sockaddr;extern int user_port _DEFVAL(0);extern char hostname[80];extern bool is_ipv6 _DEFVAL(false);extern int start_calls _DEFVAL(0);extern double reset_number _DEFVAL(0);extern int reset_close _DEFVAL(1);extern int reset_sleep _DEFVAL(1000);extern struct addrinfo * local_addr_storage;#ifdef __3PCC__extern int twinSippSocket _DEFVAL(0);extern int localTwinSippSocket _DEFVAL(0);extern struct sockaddr_storage twinSipp_sockaddr;#endifextern struct sockaddr_storage remote_sockaddr;extern short use_remote_sending_addr _DEFVAL(0);extern struct sockaddr_storage remote_sending_sockaddr;enum E_Alter_YesNo { E_ALTER_YES=0, E_ALTER_NO };/************************** Trace Files ***********************/extern FILE * screenf _DEFVAL(0);extern FILE * logfile _DEFVAL(0);extern FILE * messagef _DEFVAL(0);extern FILE * timeoutf _DEFVAL(0);extern bool useMessagef _DEFVAL(0);extern bool useScreenf _DEFVAL(0);extern bool useLogf _DEFVAL(0);extern bool useTimeoutf _DEFVAL(0);extern bool dumpInFile _DEFVAL(0);extern bool dumpInRtt _DEFVAL(0);extern char * scenario_file;#define TRACE_MSG(arg) \{ \ if(messagef) { \ FILE * s = messagef; \ fprintf arg; \ fflush(messagef); \ } \}#define LOG_MSG(arg) \{ \ if(logfile) { \ FILE * s = logfile; \ fprintf arg; \ fflush(logfile); \ } \}#define TRACE_TIMEOUT(arg) \{ \ if(timeoutf) { \ FILE * s = timeoutf; \ fprintf arg; \ fflush(timeoutf); \ } \}/********************* Mini-Parser Routines *******************/int get_method(char *msg);char * get_peer_tag(char *msg);unsigned long int get_cseq_value(char *msg);unsigned long get_reply_code(char *msg);/********************** Network Interfaces ********************/void sipp_customize_socket(int socket);int send_message(int s, void ** comp_state, char * msg);#ifdef _USE_OPENSSLint send_message_tls(SSL *s, void ** comp_state, char * msg);#endifvoid pollset_remove(int idx);int pollset_add(call * p_call, int socket);#if defined (__hpux) || defined (__alpha) && !defined (__FreeBSD__)#define sipp_socklen_t int#else#define sipp_socklen_t socklen_t#endif#define SOCK_ADDR_SIZE(a) \ (((a)->ss_family == AF_INET) ? sizeof(struct sockaddr_in) \ : sizeof(struct sockaddr_in6))#if defined(__cplusplus) && defined (__hpux)#define _RCAST(type, val) (reinterpret_cast<type> (val))#else#define _RCAST(type, val) ((type)(val))#endif/********************* Utilities functions *******************/char *strcasestr2 ( char *__haystack, char *__needle);int get_decimal_from_hex(char hex);int reset_connections() ;int close_calls();int close_connections();int open_connections();void timeout_alarm(int);/********************* Reset global kludge *******************/#ifdef GLOBALS_FULL_DEFINITION#undef extern#endif#endif // __SIPP__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -