00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _core_proxy_h
00035 #define _core_proxy_h
00036
00037 #include <netdb.h>
00038 #include "ip_addr.h"
00039 #include "str.h"
00040
00041 struct dns_node;
00042
00043 #define PROXY_SHM_FLAG (1<<0)
00044
00045 struct proxy_l{
00046 struct proxy_l* next;
00047 str name;
00048 unsigned short flags;
00049 unsigned short port;
00050 unsigned short proto;
00051
00052 unsigned short addr_idx;
00053 struct hostent host;
00054
00055 struct dns_node *dn;
00056 };
00057
00058 extern struct proxy_l* proxies;
00059
00060 struct proxy_l* add_proxy( str* name, unsigned short port,
00061 unsigned short proto);
00062
00063 struct proxy_l* mk_proxy( str* name, unsigned short port, unsigned short proto,
00064 int is_sips);
00065 struct proxy_l* mk_shm_proxy(str* name, unsigned short port, unsigned short proto,
00066 int is_sips);
00067 struct proxy_l* mk_proxy_from_ip(struct ip_addr* ip, unsigned short port,
00068 unsigned short proto);
00069
00070 void free_proxy(struct proxy_l* p);
00071 void free_shm_proxy(struct proxy_l* p);
00072
00073 void free_hostent(struct hostent *dst);
00074
00075 int hostent_cpy(struct hostent *dst, struct hostent* src);
00076
00077 int hostent_shm_cpy(struct hostent *dst, struct hostent* src);
00078
00079 void free_shm_hostent(struct hostent *dst);
00080
00081 #include "resolve.h"
00082
00083 #endif
00084