#include "config.h"
#include "globals.h"
#include "proxy.h"
#include "error.h"
#include "dprint.h"
#include "mem/mem.h"
#include "mem/shm_mem.h"
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include "resolve.h"
#include "ip_addr.h"

Go to the source code of this file.
Functions | |
| struct proxy_l * | add_proxy (str *name, unsigned short port, unsigned short proto) |
| Add a proxy to beginning of the global list, if not already there. | |
| static struct proxy_l * | find_proxy (str *name, unsigned short port, int proto) |
| Searches for a certan proxy. | |
| void | free_hostent (struct hostent *dst) |
| Free a hostent structure in pkg memory. | |
| void | free_proxy (struct proxy_l *p) |
| Free proxy in pkg memory. | |
| void | free_shm_hostent (struct hostent *dst) |
| Frees a hostent structure in shared memory. | |
| void | free_shm_proxy (struct proxy_l *p) |
| Free proxy in shared memory. | |
| int | hostent_cpy (struct hostent *dst, struct hostent *src) |
| Copies a hostent structure. | |
| int | hostent_shm_cpy (struct hostent *dst, struct hostent *src) |
| Copies a hostent structure in shared memory. | |
| struct proxy_l * | mk_proxy (str *name, unsigned short port, unsigned short proto, int is_sips) |
| Create a new proxy, but don't add it to the global list. | |
| struct proxy_l * | mk_proxy_from_ip (struct ip_addr *ip, unsigned short port, unsigned short proto) |
| Create a new proxy, but don't add it to the global list. | |
| struct proxy_l * | mk_shm_proxy (str *name, unsigned short port, unsigned short proto, int is_sips) |
| Create a new proxy, but don't add it to the global list. | |
Variables | |
| int | disable_dns_failover = 0 |
| struct proxy_l * | proxies = 0 |
Definition in file proxy.c.
Add a proxy to beginning of the global list, if not already there.
| name | proxy name | |
| port | proxy port | |
| proto | proxy protocol |
Definition at line 250 of file proxy.c.
References find_proxy(), mk_proxy(), and proxy_l::next.
Referenced by fix_actions().
Searches for a certan proxy.
Search for the proxy named 'name', on port 'port' with proto 'proto'.
| name | proxy name | |
| port | proxy port | |
| proto | proxy protocol |
Definition at line 76 of file proxy.c.
References _str::len, proxy_l::name, proxy_l::next, proxy_l::port, proxy_l::proto, PROTO_NONE, and _str::s.
Referenced by add_proxy().
| void free_hostent | ( | struct hostent * | dst | ) |
Free a hostent structure in pkg memory.
| dst | freed hostent |
Definition at line 224 of file proxy.c.
References pkg_free.
Referenced by free_proxy(), and get_next_su().
| void free_proxy | ( | struct proxy_l * | p | ) |
Free proxy in pkg memory.
Definition at line 365 of file proxy.c.
References free_dns_res(), free_hostent(), and proxy_l::host.
Referenced by ac_sl_msg(), add_uac(), do_action(), t_relay_to(), trace_send_duplicate(), and uri2su().
| void free_shm_hostent | ( | struct hostent * | dst | ) |
Frees a hostent structure in shared memory.
| dst | freed hostent |
Definition at line 127 of file proxy.c.
References shm_free.
Referenced by free_shm_proxy(), get_next_su(), and shm_clone_proxy().
| void free_shm_proxy | ( | struct proxy_l * | p | ) |
Free proxy in shared memory.
Definition at line 377 of file proxy.c.
References free_dns_res(), free_shm_hostent(), and proxy_l::host.
Referenced by conf_destroy(), and update_proxy().
| int hostent_cpy | ( | struct hostent * | dst, | |
| struct hostent * | src | |||
| ) |
Copies a hostent structure.
| dst | destination | |
| src | source |
Definition at line 140 of file proxy.c.
References E_OUT_OF_MEM, len, LM_CRIT, pkg_free, pkg_malloc, and ser_error.
Referenced by get_next_su(), and mk_proxy().
| int hostent_shm_cpy | ( | struct hostent * | dst, | |
| struct hostent * | src | |||
| ) |
Copies a hostent structure in shared memory.
| dst | destination | |
| src | source |
Definition at line 95 of file proxy.c.
References NULL, and shm_malloc().
Referenced by get_next_su(), mk_shm_proxy(), and shm_clone_proxy().
| struct proxy_l* mk_proxy | ( | str * | name, | |
| unsigned short | port, | |||
| unsigned short | proto, | |||
| int | is_sips | |||
| ) | [read] |
Create a new proxy, but don't add it to the global list.
Create a new proxy in private memory, but don't add it to the global list. This also uses SRV for lookup if possible & port==0 (quick hack).
| name | proxy hostname | |
| port | proxy port | |
| proto | proxy protocol | |
| is_sips | set to 1 if you use SIPS |
Definition at line 279 of file proxy.c.
References disable_dns_failover, proxy_l::dn, E_BAD_ADDRESS, E_OUT_OF_MEM, free_dns_res(), proxy_l::host, hostent_cpy(), _str::len, LM_CRIT, LM_DBG, proxy_l::name, pkg_free, pkg_malloc, proxy_l::port, proxy_l::proto, _str::s, ser_error, and sip_resolvehost().
Referenced by add_proxy(), do_action(), fixup_phostport2proxy(), trace_send_duplicate(), and uri2proxy().
| struct proxy_l* mk_proxy_from_ip | ( | struct ip_addr * | ip, | |
| unsigned short | port, | |||
| unsigned short | proto | |||
| ) | [read] |
Create a new proxy, but don't add it to the global list.
Create a new proxy in private memory, but don't add it to the global list. This also uses SRV for lookup if possible & port==0 (quick hack).
| ip | proxy name as IP address | |
| port | proxy port | |
| proto | proxy protocol |
Definition at line 327 of file proxy.c.
References ip_addr::addr, ip_addr::af, proxy_l::host, ip_addr::len, LM_CRIT, pkg_free, pkg_malloc, proxy_l::port, proxy_l::proto, and ip_addr::u.
| struct proxy_l* mk_shm_proxy | ( | str * | name, | |
| unsigned short | port, | |||
| unsigned short | proto, | |||
| int | is_sips | |||
| ) | [read] |
Create a new proxy, but don't add it to the global list.
Create a new proxy in shared memory, but don't add it to the global list. This also uses SRV for lookup if possible & port==0 (quick hack).
| name | proxy hostname | |
| port | proxy port | |
| proto | proxy protocol | |
| is_sips | set to 1 if you use SIPS |
Definition at line 399 of file proxy.c.
References disable_dns_failover, proxy_l::dn, E_BAD_ADDRESS, E_OUT_OF_MEM, free_dns_res(), proxy_l::host, hostent_shm_cpy(), _str::len, LM_CRIT, LM_DBG, proxy_l::name, proxy_l::port, proxy_l::proto, _str::s, ser_error, shm_free, shm_malloc(), and sip_resolvehost().
Referenced by update_proxy().
| int disable_dns_failover = 0 |
disable the DNS failover
Definition at line 63 of file proxy.c.
Referenced by mk_proxy(), and mk_shm_proxy().
1.5.6