int tcp_destruct(tcp_sock_t *tcp) { ASSERT(tcp); if (tcp->initialized == 1) tcp_exit(tcp); return ip_destruct(&tcp->ip); }
/* Resource free. */ int tcp_destruct(tcp_sock_t *p_self) { if (p_self == NULL) { return 0; } if (p_self->initialized == 1) { tcp_shutdown(p_self); } return ip_destruct(&p_self->super); }