Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
ripdump.c
Package: export.zip [view]
Upload User: hepax88
Upload Date: 2007-01-03
Package Size: 1101k
Code Size: 1k
Category:
TCP/IP Stack
Development Platform:
Visual C++
- /* RIP packet tracing
- * Copyright 1991 Phil Karn, KA9Q
- */
- #include "global.h"
- #include "mbuf.h"
- #include "netuser.h"
- #include "timer.h"
- #include "rip.h"
- #include "trace.h"
- void
- rip_dump(fp,bpp)
- FILE *fp;
- struct mbuf **bpp;
- {
- struct rip_route entry;
- int i;
- int cmd,version;
- uint16 len;
- fprintf(fp,"RIP: ");
- cmd = PULLCHAR(bpp);
- version = PULLCHAR(bpp);
- switch(cmd){
- case RIPCMD_REQUEST:
- fprintf(fp,"REQUEST");
- break;
- case RIPCMD_RESPONSE:
- fprintf(fp,"RESPONSE");
- break;
- default:
- fprintf(fp," cmd %u",cmd);
- break;
- }
- pull16(bpp); /* remove one word of padding */
- len = len_p(*bpp);
- fprintf(fp," vers %u entries %u:n",version,len / RIPROUTE);
- i = 0;
- while(len >= RIPROUTE){
- /* Pull an entry off the packet */
- pullentry(&entry,bpp);
- len -= RIPROUTE;
- if(entry.addr_fam != RIP_IPFAM) {
- /* Skip non-IP addresses */
- continue;
- }
- fprintf(fp,"%-16s%-3u ",inet_ntoa(entry.target),entry.metric);
- if((++i % 3) == 0){
- putc('n',fp);
- }
- }
- if((i % 3) != 0)
- putc('n',fp);
- }