netstat.c (7715) | netstat.c (8874) |
---|---|
1/*- 2 * Copyright (c) 1980, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 163 unchanged lines hidden (view full) --- 172 void *off; 173 int istcp; 174 175 if (namelist[X_TCB].n_value == 0) 176 return; 177 for (p = netcb.ni_forw; p != (struct netinfo *)&netcb; p = p->ni_forw) 178 p->ni_seen = 0; 179 if (protos&TCP) { | 1/*- 2 * Copyright (c) 1980, 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 163 unchanged lines hidden (view full) --- 172 void *off; 173 int istcp; 174 175 if (namelist[X_TCB].n_value == 0) 176 return; 177 for (p = netcb.ni_forw; p != (struct netinfo *)&netcb; p = p->ni_forw) 178 p->ni_seen = 0; 179 if (protos&TCP) { |
180 off = NPTR(X_TCB); | 180 off = NPTR(X_TCB); |
181 istcp = 1; 182 } 183 else if (protos&UDP) { | 181 istcp = 1; 182 } 183 else if (protos&UDP) { |
184 off = NPTR(X_UDB); | 184 off = NPTR(X_UDB); |
185 istcp = 0; 186 } 187 else { 188 error("No protocols to display"); 189 return; 190 } 191again: 192 KREAD(off, &head, sizeof (struct inpcbhead)); --- 83 unchanged lines hidden (view full) --- 276 if (namelist[X_TCB].n_type == 0) 277 return; 278 wmove(wnd, 0, 0); wclrtobot(wnd); 279 mvwaddstr(wnd, 0, LADDR, "Local Address"); 280 mvwaddstr(wnd, 0, FADDR, "Foreign Address"); 281 mvwaddstr(wnd, 0, PROTO, "Proto"); 282 mvwaddstr(wnd, 0, RCVCC, "Recv-Q"); 283 mvwaddstr(wnd, 0, SNDCC, "Send-Q"); | 185 istcp = 0; 186 } 187 else { 188 error("No protocols to display"); 189 return; 190 } 191again: 192 KREAD(off, &head, sizeof (struct inpcbhead)); --- 83 unchanged lines hidden (view full) --- 276 if (namelist[X_TCB].n_type == 0) 277 return; 278 wmove(wnd, 0, 0); wclrtobot(wnd); 279 mvwaddstr(wnd, 0, LADDR, "Local Address"); 280 mvwaddstr(wnd, 0, FADDR, "Foreign Address"); 281 mvwaddstr(wnd, 0, PROTO, "Proto"); 282 mvwaddstr(wnd, 0, RCVCC, "Recv-Q"); 283 mvwaddstr(wnd, 0, SNDCC, "Send-Q"); |
284 mvwaddstr(wnd, 0, STATE, "(state)"); | 284 mvwaddstr(wnd, 0, STATE, "(state)"); |
285} 286 287void 288shownetstat() 289{ 290 register struct netinfo *p, *q; 291 292 /* --- 89 unchanged lines hidden (view full) --- 382 while (cp - line < 22) 383 *cp++ = ' '; 384 *cp = '\0'; 385 waddstr(wnd, line); 386} 387 388/* 389 * Construct an Internet address representation. | 285} 286 287void 288shownetstat() 289{ 290 register struct netinfo *p, *q; 291 292 /* --- 89 unchanged lines hidden (view full) --- 382 while (cp - line < 22) 383 *cp++ = ' '; 384 *cp = '\0'; 385 waddstr(wnd, line); 386} 387 388/* 389 * Construct an Internet address representation. |
390 * If the nflag has been supplied, give | 390 * If the nflag has been supplied, give |
391 * numeric value, otherwise try for symbolic name. 392 */ 393static char * 394inetname(in) 395 struct in_addr in; 396{ 397 char *cp = 0; 398 static char line[50]; --- 65 unchanged lines hidden --- | 391 * numeric value, otherwise try for symbolic name. 392 */ 393static char * 394inetname(in) 395 struct in_addr in; 396{ 397 char *cp = 0; 398 static char line[50]; --- 65 unchanged lines hidden --- |