1 /* 2 * Copyright (c) 2004-2006 Maxim Sobolev <sobomax@FreeBSD.org> 3 * Copyright (c) 2006-2014 Sippy Software, Inc., http://www.sippysoft.com 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28 29 #ifndef _RTPP_CFG_STABLE_H_ 30 #define _RTPP_CFG_STABLE_H_ 31 32 /* 33 * TTL counters are used to detect the absence of audio packets 34 * in either direction. When the counter reaches 0, the call timeout 35 * occurs. 36 */ 37 enum rtpp_ttl_mode { 38 TTL_UNIFIED = 0, /* all TTL counters must reach 0 */ 39 TTL_INDEPENDENT = 1 /* any TTL counter reaches 0 */ 40 }; 41 42 typedef enum rtpp_ttl_mode rtpp_ttl_mode; 43 44 struct rtpp_timed; 45 struct rtpp_sessinfo; 46 struct rtpp_log; 47 struct rtpp_module_if; 48 49 #define RTPP_PT_INET 0 50 #define RTPP_PT_INET6 1 51 #define RTPP_PT_MAX RTPP_PT_INET6 52 #define RTPP_PT_LEN (RTPP_PT_MAX + 1) 53 #define RTPP_PT_SELECT(cp, af) (((af) == AF_INET) ? \ 54 (cp)->port_table[RTPP_PT_INET] : (cp)->port_table[RTPP_PT_INET6]) 55 56 struct rtpp_cfg_stable { 57 const char *pid_file; 58 59 int nodaemon; 60 int no_chdir; 61 int dmode; 62 int bmode; /* Bridge mode */ 63 int port_min; /* Lowest UDP port for RTP */ 64 int port_max; /* Highest UDP port number for RTP */ 65 int seq_ports; /* Allocate ports in sequential manner rather than randomly */ 66 int port_ctl; /* Port number for UDP control, 0 for Unix domain */ 67 int max_ttl; 68 int max_setup_ttl; 69 /* 70 * The first address is for external interface, the second one - for 71 * internal one. Second can be NULL, in this case there is no bridge 72 * mode enabled. 73 */ 74 struct sockaddr *bindaddr[2]; /* RTP socket(s) addresses */ 75 char const * advaddr[2]; /* advertised addresses */ 76 int tos; 77 78 const char *rdir; 79 const char *sdir; 80 int record_pcap; /* Record in the PCAP format? */ 81 int record_all; /* Record everything */ 82 83 int rrtcp; /* Whether or not to relay RTCP? */ 84 struct rtpp_log *glog; 85 86 struct rlimit *nofile_limit; 87 char *run_uname; 88 char *run_gname; 89 mode_t sock_mode; 90 int no_check; 91 92 rtpp_ttl_mode ttl_mode; 93 94 uid_t run_uid; 95 gid_t run_gid; 96 97 int log_level; 98 int log_facility; 99 100 struct rtpp_port_table *port_table[RTPP_PT_LEN]; 101 102 struct rtpp_hash_table *sessions_ht; 103 struct rtpp_weakref_obj *sessions_wrt; 104 struct rtpp_weakref_obj *servers_wrt; 105 struct rtpp_weakref_obj *rtp_streams_wrt; 106 struct rtpp_weakref_obj *rtcp_streams_wrt; 107 108 double sched_offset; 109 int sched_policy; 110 int sched_hz; 111 double target_pfreq; 112 struct rtpp_cmd_async *rtpp_cmd_cf; 113 struct rtpp_proc_async *rtpp_proc_cf; 114 struct rtpp_anetio_cf *rtpp_netio_cf; 115 struct rtpp_tnotify_set *rtpp_tnset_cf; 116 struct rtpp_notify *rtpp_notify_cf; 117 int slowshutdown; 118 int fastshutdown; 119 120 struct rtpp_stats *rtpp_stats; 121 122 struct rtpp_list *ctrl_socks; 123 124 struct rtpp_timed *rtpp_timed_cf; 125 126 struct rtpp_sessinfo *sessinfo; 127 128 const char *cwd_orig; 129 130 char *mpath; 131 struct rtpp_module_if *modules_cf; 132 }; 133 134 #endif 135