38 static const char* listener_str =
"listener";
55 ods_log_error(
"[%s] create listener failed: allocator_alloc() failed",
80 ods_fatal_exit(
"[%s] fatal unable to add interface: allocator_alloc() failed",
134 fprintf(fd,
"<Interface>");
136 fprintf(fd,
"<IPv4>%s</IPv4>", i->
address);
138 fprintf(fd,
"<IPv6>%s</IPv6>", i->
address);
141 fprintf(fd,
"<Port>%s</Port>", i->
port);
143 fprintf(fd,
"</Interface>\n");
156 if (!fd || !listener || listener->
count <= 0) {
159 fprintf(fd,
"<Listener>\n");
160 for (i=0; i < listener->
count; i++) {
161 interface_print(fd, &listener->
interfaces[i]);
163 fprintf(fd,
"</Listener>\n");
178 ods_log_debug(
"[%s] FAMILY[%s] ADDRESS[%s] PORT[%s]", listener_str,
179 i->
family==AF_INET6?
"IPv6":
"IPv4",
194 if (!listener || listener->
count <= 0) {
197 for (i=0; i < listener->
count; i++) {
214 free((
void*)i->
port);
232 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)