#include <xinu.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
◆ xsh_udpdump()
shellcmd xsh_udpdump |
( |
int |
nargs, |
|
|
char * |
args[] |
|
) |
| |
Definition at line 11 of file xsh_udpdump.c.
References fprintf(), printf(), stderr, strncmp(), udpentry::udcount, udpentry::udlocport, UDP_FREE, UDP_SLOTS, udpentry::udpid, udptab, udpentry::udremip, udpentry::udremport, and udpentry::udstate.
15 "free ",
"used ",
"recv "};
26 if (nargs == 2 &&
strncmp(args[1],
"--help", 7) == 0) {
27 printf(
"Use: %s\n\n", args[0]);
29 printf(
"\tDisplays registerd UDP ports\n");
31 printf(
"\t--help\t display this help and exit\n");
46 printf(
"%5s %5s %5s %9s %8s %8s %3s %4s\n",
47 "Entry",
"Iface",
"State",
"Remote IP",
"Rem Port",
48 "Loc Port",
"Pid",
"Pkts");
49 printf(
"%5s %5s %5s %15s %8s %8s %3s %4s\n",
50 "-----",
"-----",
"-----",
"---------------",
"--------",
51 "--------",
"---",
"----");
57 printf(
"%3d ---- slot is free ---\n", i);
61 r1 = (remip >> 24) & 0xff;
62 r2 = (remip >> 16) & 0xff;
63 r3 = (remip >> 8) & 0xff;
69 printf(
" %4s %3d.%3d.%3d.%3d %5d %6d%5d%6d\n",
70 udpstate[state], r1, r2, r3, r4, remprt, locprt, pid,
int32 strncmp(const char *, const char *, int32)
int32 printf(const char *,...)
int int32
符号あり32ビット整数(int)
int32 fprintf(int, char *,...)
unsigned int uint32
符号なし32ビット整数(unsigned int)