Lines Matching refs:port
77 struct lsock_port *port = (struct lsock_port *)tp;
79 (void)remove(port->name);
104 * Open a local port. If this is a datagram socket create also the
111 struct lsock_port *port;
146 if ((port = malloc(sizeof(*port))) == NULL)
149 memset(port, 0, sizeof(*port));
152 free(port);
157 if ((port->name = malloc(namelen + 1)) == NULL) {
158 free(port);
163 strncpy(port->name, name, namelen);
164 port->name[namelen] = '\0';
166 port->type = type;
167 port->str_sock = -1;
168 LIST_INIT(&port->peers);
170 port->tport.index.len = namelen + 1;
171 port->tport.index.subs[0] = namelen;
173 port->tport.index.subs[u + 1] = name[u];
176 LIST_INSERT_HEAD(&port->peers, peer, link);
178 peer->port = port;
187 trans_insert_port(my_trans, &port->tport);
190 (err = lsock_init_port(&port->tport)) != SNMP_ERR_NOERROR) {
191 lsock_close_port(&port->tport);
195 *pp = port;
213 * Close a local port
218 struct lsock_port *port = (struct lsock_port *)tp;
221 if (port->str_id != NULL)
222 fd_deselect(port->str_id);
223 if (port->str_sock >= 0)
224 (void)close(port->str_sock);
225 (void)remove(port->name);
229 while ((peer = LIST_FIRST(&port->peers)) != NULL)
232 free(port->name);
233 free(port);
243 struct lsock_port *p = peer->port;
268 peer->port = p;
425 * Dependency to create a lsock port
434 /* the port */
435 struct lsock_port *port;
440 /* type of the port */
466 else if (ld->port == NULL) {
473 &ld->port, ld->type);
489 lsock_close_port(&ld->port->tport);
495 lsock_close_port(&ld->port->tport);
503 * Local port table
552 ld->port = p;