36 static const char* listener_str =
"listener";
53 ods_log_error(
"[%s] create listener failed: allocator_alloc() failed",
78 ods_fatal_exit(
"[%s] fatal unable to add interface: allocator_alloc() failed",
132 fprintf(fd,
"<Interface>");
134 fprintf(fd,
"<IPv4>%s</IPv4>", i->
address);
136 fprintf(fd,
"<IPv6>%s</IPv6>", i->
address);
139 fprintf(fd,
"<Port>%s</Port>", i->
port);
141 fprintf(fd,
"</Interface>\n");
154 if (!fd || !listener || listener->
count <= 0) {
157 fprintf(fd,
"<Listener>\n");
158 for (i=0; i < listener->
count; i++) {
159 interface_print(fd, &listener->
interfaces[i]);
161 fprintf(fd,
"</Listener>\n");
176 ods_log_debug(
"[%s] FAMILY[%s] ADDRESS[%s] PORT[%s]", listener_str,
177 i->
family==AF_INET6?
"IPv6":
"IPv4",
192 if (!listener || listener->
count <= 0) {
195 for (i=0; i < listener->
count; i++) {
212 free((
void*)i->
port);
230 for (i=0; i < listener->
count; i++) {
void listener_cleanup(listener_type *listener)
void ods_log_debug(const char *format,...)
void * allocator_alloc(allocator_type *allocator, size_t size)
void ods_fatal_exit(const char *format,...)
void ods_log_error(const char *format,...)
void listener_log(listener_type *listener)
listener_type * listener_create(allocator_type *allocator)
char * allocator_strdup(allocator_type *allocator, const char *string)
void interface_cleanup(interface_type *i)
void listener_print(FILE *fd, listener_type *listener)
interface_type * interfaces
void allocator_deallocate(allocator_type *allocator, void *data)
struct interface_struct interface_type
union acl_addr_storage addr
#define ods_log_assert(x)
allocator_type * allocator
interface_type * listener_push(listener_type *listener, char *address, int family, char *port)