/* adds a new sock_info structure to the corresponding list * return 0 on success, -1 on error */ int new_sock2list(char* name, unsigned short port, unsigned short proto, enum si_flags flags, struct socket_info** list) { struct socket_info* si; si=new_sock_info(name, port, proto, flags); if (si==0){ LOG(L_ERR, "ERROR: add_listen_iface: new_sock_info failed\n"); goto error; } sock_listadd(list, si); return 0; error: return -1; }
/* adds a new sock_info structure to the corresponding list * return 0 on success, -1 on error */ int new_sock2list(char* name, unsigned short port, unsigned short proto, char *adv_name, unsigned short adv_port, unsigned short children, enum si_flags flags, struct socket_info** list) { struct socket_info* si; si=new_sock_info(name, port, proto, adv_name, adv_port, children, flags); if (si==0){ LM_ERR("new_sock_info failed\n"); goto error; } sock_listadd(list, si); return 0; error: return -1; }