main file (init, daemonize, startup)Module: core More...
#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <ctype.h>#include <string.h>#include <netdb.h>#include <unistd.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <netinet/ip.h>#include <arpa/inet.h>#include <sys/utsname.h>#include <sys/stat.h>#include <sys/mman.h>#include <fcntl.h>#include <sys/time.h>#include <sys/wait.h>#include <pwd.h>#include <grp.h>#include <signal.h>#include <sys/ioctl.h>#include <net/if.h>#include "config.h"#include "dprint.h"#include "daemonize.h"#include "route.h"#include "udp_server.h"#include "globals.h"#include "mem/mem.h"#include "sr_module.h"#include "timer.h"#include "parser/msg_parser.h"#include "ip_addr.h"#include "resolve.h"#include "parser/parse_hname2.h"#include "parser/digest/digest_parser.h"#include "name_alias.h"#include "hash_func.h"#include "pt.h"#include "script_cb.h"#include "nonsip_hooks.h"#include "ut.h"#include "signals.h"#include "usr_avp.h"#include "rpc_lookup.h"#include "core_cmd.h"#include "flags.h"#include "lock_ops_init.h"#include "atomic_ops_init.h"#include "rand/fastrand.h"#include "stats.h"#include "counters.h"#include "cfg/cfg.h"#include "cfg/cfg_struct.h"#include "cfg_core.h"#include "endianness.h"#include "basex.h"#include "pvapi.h"#include "pv_core.h"#include "ppcfg.h"#include "sock_ut.h"#include "ver.h"Go to the source code of this file.
Definition in file main.c.
| int fix_cfg_file | ( | void | ) |
The function updates the value of cfg_file global variable to contain full absolute pathname to the main configuration file of SER. The function uses CFG_FILE macro to determine the default path to the configuration file if the user did not specify one using the command line option. If cfg_file contains an absolute pathname then it is used unmodified, if it contains a relative pathanme than the value returned by getcwd function will be added at the beginning. This function must be run before SER changes its current working directory to / (in daemon mode).
| int parse_phostport | ( | char * | s, | |
| char ** | host, | |||
| int * | hlen, | |||
| int * | port, | |||
| int * | proto | |||
| ) |
parses [proto:]host[:port] or [proto:](host_1, host_2, ... host_n)[:port] where proto= udp|tcp|tls|sctp
| s | - string (like above) | |
| host | - will be filled with the host part Note: for multi-homing it wil contain all the addresses (e.g.: "sctp:(1.2.3.4, 5.6.7.8)" => host="(1.2.3.4, 5.6.7.8)") | |
| hlen | - will be filled with the length of the host part. | |
| port | - will be filled with the port if present or 0 if it's not. | |
| proto | - will be filled with the protocol if present or PROTO_NONE if it's not. |
Definition at line 1107 of file main.c.
Referenced by dbrow2info(), dp_apply_policy(), get_all_db_ucontacts(), and parse_phostport_mh().

| static struct name_lst* parse_phostport_mh | ( | char * | s, | |
| char ** | host, | |||
| int * | hlen, | |||
| int * | port, | |||
| int * | proto | |||
| ) | [static, read] |
parses [proto:]host[:port] or [proto:](host_1, host_2, ... host_n)[:port] where proto= udp|tcp|tls|sctp
| s | - string (like above) | |
| host | - will be filled with the host part Note: for multi-homing it wil contain all the addresses (e.g.: "sctp:(1.2.3.4, 5.6.7.8)" => host="(1.2.3.4, 5.6.7.8)") | |
| hlen | - will be filled with the length of the host part. | |
| port | - will be filled with the port if present or 0 if it's not. | |
| proto | - will be filled with the protocol if present or PROTO_NONE if it's not. |
Definition at line 1206 of file main.c.
References parse_phostport().

1.7.1