Lines Matching defs:state
35 portbind(register Cs_t* state, const char* type, unsigned long addr, unsigned int port)
48 messagef((state->id, NiL, -1, "bind: %s: udp_datagram error", type));
53 messagef((state->id, NiL, -1, "bind: %s: udp_connect error", type));
60 messagef((state->id, NiL, -1, "bind: %s: tcp_sock error", type));
68 state->addr = tcp.laddr;
69 state->port = tcp.lport;
72 messagef((state->id, NiL, -1, "bind: %s %s error", type, addr ? "tcp_connect" : "tcp_listen"));
90 messagef((state->id, NiL, -1, "bind: %s: invalid type", type));
95 messagef((state->id, NiL, -1, "bind: %s: AF_INET socket error", type));
101 state->addr = addr;
102 state->port = port;
112 if (state->flags & CS_ADDR_NOW)
136 if (!r && (state->flags & CS_ADDR_NOW))
150 state->addr = nam.sin_addr.s_addr;
151 state->port = port;
154 messagef((state->id, NiL, -1, "bind: %s: connect error", type));
161 if (state->port != CS_PORT_NORMAL)
172 state->addr = nam.sin_addr.s_addr;
173 state->port = ntohs((unsigned short)nam.sin_port);
175 else messagef((state->id, NiL, -1, "bind: %s: getsockname error", type));
178 messagef((state->id, NiL, -1, "bind: %s: bind error", type));
186 messagef((state->id, NiL, -1, "bind: %s: not supported", type));
206 csbind(register Cs_t* state, const char* type, unsigned long addr, unsigned long port, unsigned long clone)
210 messagef((state->id, NiL, -8, "bind(%s,%s,%u,%lu) call", type, csntoa(state, addr), port, clone));
220 messagef((state->id, NiL, -1, "bind: %s: explicit reserved port invalid", csntoa(state, addr)));
231 messagef((state->id, NiL, -1, "bind: no more reserved ports"));
234 if ((fd = portbind(state, type, 0L, last)) >= 0)
237 messagef((state->id, NiL, -1, "bind: reserved port allocation error"));
245 if ((fd = portbind(state, type, addr, port)) < 0)
253 cswrite(state, fd, buf, n);
256 messagef((state->id, NiL, -8, "bind(%s,%s,%u,%lu) = %d", type, csntoa(state, addr), port, clone, fd));