home *** CD-ROM | disk | FTP | other *** search
- /* UDP-related user commands */
- #include <stdio.h>
- #include "global.h"
- #include "mbuf.h"
- #include "netuser.h"
- #include "udp.h"
- #include "internet.h"
- #include "cmdparse.h"
- #include "misc.h"
-
- struct cmds udpcmds[] = {
- "status", doudpstat, 0, NULLCHAR, NULLCHAR,
- NULLCHAR, NULLFP, 0,
- "udp subcommands: status", NULLCHAR,
- };
-
- int doudp(int argc, char **argv)
- {
- return subcmd(udpcmds,argc,argv);
- }
- /* Dump UDP statistics and control blocks */
- int doudpstat(int argc, char **argv)
- {
- extern struct udp_stat udp_stat;
- register struct udp_cb *udp;
- register int i;
-
- argc = argc;
- argv = argv;
-
- cwprintf(NULL, "sent %u rcvd %u bdcsts %u cksum err %u unknown socket %u\r\n",
- udp_stat.sent,udp_stat.rcvd,udp_stat.bdcsts,udp_stat.cksum,udp_stat.unknown);
- cwprintf(NULL, " &UCB Rcv-Q Local socket\r\n");
- for(i=0;i<NUDP;i++){
- for(udp = udps[i];udp != NULLUDP; udp = udp->next){
- cwprintf(NULL, "%8lx%6u %s\r\n",(long)udp,udp->rcvcnt,
- psocket(&udp->socket));
- }
- }
-
- return 0;
- }
-
-