Lines Matching refs:inp

39 	register struct inpcb *inp;  local
41 MALLOC(inp, struct inpcb *, sizeof(*inp), M_PCB, M_NOWAIT);
42 if (inp == NULL)
44 bzero((caddr_t)inp, sizeof(*inp));
45 inp->inp_head = head;
46 inp->inp_socket = so;
47 insque(inp, head);
48 so->so_pcb = (caddr_t)inp;
53 in_pcbbind(inp, nam) in in_pcbbind() argument
54 register struct inpcb *inp; in in_pcbbind()
57 register struct socket *so = inp->inp_socket;
58 register struct inpcb *head = inp->inp_head;
67 if (inp->inp_lport || inp->inp_laddr.s_addr != INADDR_ANY)
113 inp->inp_laddr = sin->sin_addr;
122 zeroin_addr, 0, inp->inp_laddr, lport, wild));
123 inp->inp_lport = lport;
134 in_pcbconnect(inp, nam) in in_pcbconnect() argument
135 register struct inpcb *inp; in in_pcbconnect()
165 if (inp->inp_laddr.s_addr == INADDR_ANY) {
173 ro = &inp->inp_route;
177 inp->inp_socket->so_options & SO_DONTROUTE)) {
181 if ((inp->inp_socket->so_options & SO_DONTROUTE) == 0 && /*XXX*/
218 inp->inp_moptions != NULL) {
222 imo = inp->inp_moptions;
234 if (in_pcblookup(inp->inp_head,
237 inp->inp_laddr.s_addr ? inp->inp_laddr : ifaddr->sin_addr,
238 inp->inp_lport,
241 if (inp->inp_laddr.s_addr == INADDR_ANY) {
242 if (inp->inp_lport == 0)
243 (void)in_pcbbind(inp, (struct mbuf *)0);
244 inp->inp_laddr = ifaddr->sin_addr;
246 inp->inp_faddr = sin->sin_addr;
247 inp->inp_fport = sin->sin_port;
252 in_pcbdisconnect(inp) in in_pcbdisconnect() argument
253 struct inpcb *inp; in in_pcbdisconnect()
256 inp->inp_faddr.s_addr = INADDR_ANY;
257 inp->inp_fport = 0;
258 if (inp->inp_socket->so_state & SS_NOFDREF)
259 in_pcbdetach(inp);
263 in_pcbdetach(inp) in in_pcbdetach() argument
264 struct inpcb *inp; in in_pcbdetach()
266 struct socket *so = inp->inp_socket;
270 if (inp->inp_options)
271 (void)m_free(inp->inp_options);
272 if (inp->inp_route.ro_rt)
273 rtfree(inp->inp_route.ro_rt);
274 ip_freemoptions(inp->inp_moptions);
275 remque(inp);
276 FREE(inp, M_PCB);
280 in_setsockaddr(inp, nam) in in_setsockaddr() argument
281 register struct inpcb *inp; in in_setsockaddr()
291 sin->sin_port = inp->inp_lport;
292 sin->sin_addr = inp->inp_laddr;
296 in_setpeeraddr(inp, nam) in in_setpeeraddr() argument
297 struct inpcb *inp; in in_setpeeraddr()
307 sin->sin_port = inp->inp_fport;
308 sin->sin_addr = inp->inp_faddr;
332 register struct inpcb *inp, *oinp; local
358 for (inp = head->inp_next; inp != head;) {
359 if (inp->inp_faddr.s_addr != faddr.s_addr ||
360 inp->inp_socket == 0 ||
361 (lport && inp->inp_lport != lport) ||
362 (laddr.s_addr && inp->inp_laddr.s_addr != laddr.s_addr) ||
363 (fport && inp->inp_fport != fport)) {
364 inp = inp->inp_next;
367 oinp = inp;
368 inp = inp->inp_next;
381 in_losing(inp) in in_losing() argument
382 struct inpcb *inp; in in_losing()
387 if ((rt = inp->inp_route.ro_rt)) {
388 inp->inp_route.ro_rt = 0;
391 (struct sockaddr *)&inp->inp_route.ro_dst;
413 in_rtchange(inp, errno) in in_rtchange() argument
414 register struct inpcb *inp; in in_rtchange()
417 if (inp->inp_route.ro_rt) {
418 rtfree(inp->inp_route.ro_rt);
419 inp->inp_route.ro_rt = 0;
434 register struct inpcb *inp, *match = 0; local
438 for (inp = head->inp_next; inp != head; inp = inp->inp_next) {
439 if (inp->inp_lport != lport)
442 if (inp->inp_laddr.s_addr != INADDR_ANY) {
445 else if (inp->inp_laddr.s_addr != laddr.s_addr)
451 if (inp->inp_faddr.s_addr != INADDR_ANY) {
454 else if (inp->inp_faddr.s_addr != faddr.s_addr ||
455 inp->inp_fport != fport)
464 match = inp;