Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

PcapLiveNetwork Class Reference

Inheritance diagram for PcapLiveNetwork:

Inheritance graph
[legend]
Collaboration diagram for PcapLiveNetwork:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PcapLiveNetwork ()
NetworkAddressladdr ()
NetworkAddressnaddr ()
int rchannel ()
int schannel ()
int recv (u_char *buf, int len, sockaddr &, double &)
int recv (netpkt_handler callback, void *clientdata)
int send (u_char *buf, int len)
void close ()
void reset ()
int filter (const char *)
int stat_pkts ()
int stat_pdrops ()
int mode ()

Static Public Member Functions

int nonblock (int fd)
int parsemode (const char *)
char * modename (int)

Public Attributes

double offset_
double t_firstpkt_

Protected Member Functions

double gents (pcap_pkthdr *)
int devtonaddr (const char *name, NetworkAddress &)
int open (int mode)
int open (int mode, const char *)
int command (int argc, const char *const *argv)
int skiphdr ()
const char * autodevname ()
void bindvars ()

Static Protected Member Functions

void phandler (u_char *u, const pcap_pkthdr *h, const u_char *p)
void phandler_callback (u_char *u, const pcap_pkthdr *h, const u_char *p)

Protected Attributes

int snaplen_
int promisc_
double timeout_
NetworkAddress linkaddr_
NetworkAddress netaddr_
unsigned int local_net_
int dlink_type_
char errbuf_ [PCAP_ERRBUF_SIZE]
char srcname_ [PATH_MAX]
int pfd_
int pcnt_
int state_
int optimize_
pcap_t * pcap_
bpf_program bpfpgm_
pcap_stat pcs_
unsigned int local_netmask_
int mode_

Constructor & Destructor Documentation

PcapLiveNetwork::PcapLiveNetwork  )  [inline]
 

Definition at line 161 of file net-pcap.cc.

References bindvars(), dlink_type_, NetworkAddress::len_, linkaddr_, local_net_, netaddr_, and PcapNetwork::reset().

00161                           : local_net_(0), dlink_type_(-1) {
00162                 linkaddr_.len_ = 0;
00163                 netaddr_.len_ = 0;
00164                 bindvars(); reset();
00165         }

Here is the call graph for this function:


Member Function Documentation

const char * PcapLiveNetwork::autodevname  )  [protected]
 

Definition at line 571 of file net-pcap.cc.

References PcapNetwork::errbuf_.

Referenced by open().

00572 {
00573         const char *dname;
00574         if ((dname = pcap_lookupdev(errbuf_)) == NULL) {
00575                 fprintf(stderr, "warning: PcapNet/Live(%s) : %s\n",
00576                         name(), errbuf_);
00577                 return (NULL);
00578         }
00579         return (dname); // ptr to static data in pcap library
00580 }

void PcapLiveNetwork::bindvars  )  [protected, virtual]
 

Implements PcapNetwork.

Definition at line 633 of file net-pcap.cc.

References PcapNetwork::bindvars(), PcapNetwork::offset_, promisc_, snaplen_, and timeout_.

Referenced by PcapLiveNetwork().

00634 {
00635         bind("snaplen_", &snaplen_);
00636         bind_bool("promisc_", &promisc_);
00637         bind_time("timeout_", &timeout_);
00638         bind("offset_", &offset_);
00639         PcapNetwork::bindvars();
00640 }

Here is the call graph for this function:

void PcapNetwork::close  )  [inherited]
 

Definition at line 254 of file net-pcap.cc.

References PcapNetwork::pcap_, PNET_PSTATE_ACTIVE, PcapNetwork::reset(), and PcapNetwork::state_.

Referenced by PcapNetwork::command(), PcapFileNetwork::open(), and open().

00255 {
00256         if (state_ == PNET_PSTATE_ACTIVE && pcap_)
00257                 pcap_close(pcap_);
00258         reset();
00259 }

Here is the call graph for this function:

int PcapLiveNetwork::command int  argc,
const char *const *  argv
[protected, virtual]
 

XXX: only for ethernet now

Reimplemented from PcapNetwork.

Definition at line 654 of file net-pcap.cc.

References NetworkAddress::addr_, PcapNetwork::command(), Ethernet::etheraddr_string(), NetworkAddress::len_, linkaddr_, Network::mode(), netaddr_, open(), Network::parsemode(), and PcapNetwork::srcname_.

00655 {
00656 
00657         Tcl& tcl = Tcl::instance();
00658         if (argc == 2) {
00659                 if (strcmp(argv[1], "linkaddr") == 0) {
00661                         tcl.result(Ethernet::etheraddr_string(linkaddr_.addr_));
00662                         return (TCL_OK);
00663                 }
00664                 if (strcmp(argv[1], "netaddr") == 0) {
00665                         if (netaddr_.len_ != 4) {
00666                                 fprintf(stderr,
00667                                   "PcapLive(%s): net addr not len 4 (%d)\n",
00668                                         name(), netaddr_.len_);
00669                                 return (TCL_ERROR);
00670                         }
00671                         tcl.resultf("%d.%d.%d.%d",
00672                                 netaddr_.addr_[0],
00673                                 netaddr_.addr_[1],
00674                                 netaddr_.addr_[2],
00675                                 netaddr_.addr_[3]);
00676                         return (TCL_OK);
00677                 }
00678         } else if (argc == 3) {
00679                 // $obj open mode
00680                 if (strcmp(argv[1], "open") == 0) {
00681                         int mode = parsemode(argv[2]);
00682                         if (open(mode) < 0)
00683                                 return (TCL_ERROR);
00684                         tcl.result(srcname_);
00685                         return (TCL_OK);
00686                 }
00687         } else if (argc == 4) {
00688                 // $obj open mode devicename
00689                 if (strcmp(argv[1], "open") == 0) {
00690                         int mode = parsemode(argv[2]);
00691                         if (open(mode, argv[3]) < 0)
00692                                 return (TCL_ERROR);
00693                         tcl.result(srcname_);
00694                         return (TCL_OK);
00695                 }
00696         }
00697         return (PcapNetwork::command(argc, argv));
00698 }

Here is the call graph for this function:

int PcapLiveNetwork::devtonaddr const char *  name,
NetworkAddress
[protected]
 

Definition at line 591 of file net-pcap.cc.

References NetworkAddress::addr_, and NetworkAddress::len_.

Referenced by open().

00592 {
00593         register int fd;
00594         ifreq ifr;
00595                                 
00596         fd = socket(AF_INET, SOCK_DGRAM, 0);
00597         if (fd < 0) {       
00598                 fprintf(stderr,
00599                         "PcapLiveNet(%s): devtoaddr: couldn't create sock\n",
00600                         name());
00601                 return (-1);
00602         }
00603         memset(&ifr, 0, sizeof(ifr));
00604 #ifdef linux
00605         /* XXX Work around Linux kernel bug */
00606         ifr.ifr_addr.sa_family = AF_INET;
00607 #endif   
00608         (void)strncpy(ifr.ifr_name, devname, sizeof(ifr.ifr_name));
00609         if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) < 0) {
00610                 fprintf(stderr, "PcapLiveNetwork(%s): devtoaddr: no addr\n",
00611                         name());
00612                 (void)::close(fd);   
00613                 return (-1);
00614         }               
00615         sockaddr* sa = &ifr.ifr_addr;
00616         if (sa->sa_family != AF_INET) {
00617                 fprintf(stderr,
00618                         "PcapLiveNet(%s): af not AF_INET (%d)\n",
00619                         name(), sa->sa_family);
00620         }
00621         sockaddr_in* sin = (sockaddr_in*) sa;
00622         na.len_ = 4;                            // for now, assump IPv4
00623         memset(na.addr_, 0, sizeof(na.addr_));
00624         unsigned sz = sizeof(na.addr_);
00625         if (sizeof(ifr) < sz)
00626                 sz = sizeof(ifr);
00627         memcpy(na.addr_, &sin->sin_addr, sz);
00628         return (0);
00629 }

int PcapNetwork::filter const char *   )  [inherited]
 

Definition at line 265 of file net-pcap.cc.

References PcapNetwork::bpfpgm_, PcapNetwork::local_netmask_, PcapNetwork::optimize_, and PcapNetwork::pcap_.

Referenced by PcapNetwork::command().

00266 {
00267         if (pcap_compile(pcap_, &bpfpgm_, (char *)pgm,
00268             optimize_, local_netmask_) < 0) {
00269                 fprintf(stderr, "pcapnet obj(%s): couldn't compile filter pgm",
00270                         name());
00271                 return -1;
00272         }
00273         if (pcap_setfilter(pcap_, &bpfpgm_) < 0) {
00274                 fprintf(stderr, "pcapnet obj(%s): couldn't set filter pgm",
00275                         name());
00276                 return -1;
00277         }
00278         return(bpfpgm_.bf_len);
00279 }

double PcapLiveNetwork::gents pcap_pkthdr *   )  [inline, protected, virtual]
 

Implements PcapNetwork.

Definition at line 169 of file net-pcap.cc.

References Scheduler::clock(), and Scheduler::instance().

00169                                    {
00170                 return Scheduler::instance().clock();
00171         }

Here is the call graph for this function:

NetworkAddress& PcapLiveNetwork::laddr  )  [inline]
 

Definition at line 166 of file net-pcap.cc.

References linkaddr_.

00166 { return (linkaddr_); }

int Network::mode  )  [inline, inherited]
 

Definition at line 71 of file net.h.

References Network::mode_.

Referenced by PcapFileNetwork::command(), command(), IPNetwork::command(), TapAgent::linknet(), TCPTapAgent::recvpkt(), TapAgent::recvpkt(), IPTapAgent::recvpkt(), TCPTapAgent::sendpkt(), TapAgent::sendpkt(), and IPTapAgent::sendpkt().

00071 { return mode_; }

char * Network::modename int   )  [static, inherited]
 

Definition at line 154 of file net.cc.

Referenced by Network::command().

00155 {
00156         switch (mode) {
00157         case O_RDONLY:
00158                 return ("readonly");
00159         case O_WRONLY:
00160                 return ("writeonly");
00161         case O_RDWR:
00162                 return ("readwrite");
00163         }
00164         return ("unknown");
00165 }

NetworkAddress& PcapLiveNetwork::naddr  )  [inline]
 

Definition at line 167 of file net-pcap.cc.

References netaddr_.

00167 { return (netaddr_); }

int Network::nonblock int  fd  )  [static, inherited]
 

Definition at line 111 of file net.cc.

Referenced by UDPIPNetwork::open().

00112 {       
00113 #ifdef WIN32
00114         u_long flag = 1;
00115         if (ioctlsocket(fd, FIONBIO, &flag) == -1) {
00116                 fprintf(stderr,
00117                     "Network::nonblock(): ioctlsocket: FIONBIO: %lu\n",
00118                     GetLastError());
00119                 return -1;
00120         }
00121 #else
00122         int flags;
00123         if ((flags = fcntl(fd, F_GETFL, 0)) < 0) {
00124                 perror("Network::nonblock(): fcntl");
00125                 return (-1);
00126         }
00127 #if defined(hpux) || defined(__hpux)
00128         flags |= O_NONBLOCK;
00129 #else
00130         flags |= O_NONBLOCK|O_NDELAY;
00131 #endif
00132         if (fcntl(fd, F_SETFL, flags) == -1) {
00133                 perror("Network::nonblock(): fcntl: F_SETFL");
00134                 return -1;
00135         }
00136 #endif
00137         return 0;
00138 }

int PcapLiveNetwork::open int  mode,
const char * 
[protected, virtual]
 

Implements PcapNetwork.

Definition at line 477 of file net-pcap.cc.

References NetworkAddress::addr_, PcapNetwork::close(), devtonaddr(), dlink_type_, PcapNetwork::errbuf_, ETHER_ADDR_LEN, NetworkAddress::len_, linkaddr_, local_net_, PcapNetwork::local_netmask_, Network::mode_, netaddr_, PcapNetwork::pcap_, PcapNetwork::pfd_, PNET_PSTATE_ACTIVE, promisc_, snaplen_, PcapNetwork::srcname_, PcapNetwork::state_, and timeout_.

00478 {
00479         close();
00480 #ifdef MY_OWN_PCAP
00481         pcap_ = pcap_open_live((char*) devname, snaplen_, promisc_,
00482                                int(timeout_ * 1000.), errbuf_, mode);
00483 #else
00484         pcap_ = pcap_open_live((char*) devname, snaplen_, promisc_,
00485                                int(timeout_ * 1000.), errbuf_);
00486 #endif // MY_OWN_PCAP
00487         if (pcap_ == NULL) {
00488                 fprintf(stderr,
00489                   "pcap/live object (%s) couldn't open packet source %s: %s\n",
00490                         name(), devname, errbuf_);
00491                 return -1;
00492         }
00493         mode_ = mode;
00494         dlink_type_ = pcap_datalink(pcap_);
00495         pfd_ = pcap_fileno(pcap_);
00496         strncpy(srcname_, devname, sizeof(srcname_)-1);
00497         {
00498                 // use SIOCGIFADDR hook in bpf to get link addr
00499                 struct ifreq ifr;
00500                 struct sockaddr *sa = &ifr.ifr_addr;
00501 #ifdef HAVE_SIOCGIFHWADDR
00502                 memset(&ifr, 0, sizeof(struct ifreq));
00503                 strcpy(ifr.ifr_name, devname);
00504                 if (ioctl(pfd_, SIOCGIFHWADDR, &ifr) < 0) {
00505                         fprintf(stderr,
00506                           "pcap/live (%s) SIOCGIFHWADDR on bpf fd %d\n",
00507                           name(), pfd_);
00508                 }
00509 #else
00510                 if (ioctl(pfd_, SIOCGIFADDR, &ifr) < 0) {
00511                         fprintf(stderr,
00512                           "pcap/live (%s) SIOCGIFADDR on bpf fd %d\n",
00513                           name(), pfd_);
00514                 }
00515 #endif
00516                 if (dlink_type_ != DLT_EN10MB) {
00517                         fprintf(stderr,
00518                                 "sorry, only ethernet supported\n");
00519                         return -1;
00520                 }
00521                 linkaddr_.len_ = ETHER_ADDR_LEN;        // for now
00522                 memcpy(linkaddr_.addr_, sa->sa_data, linkaddr_.len_);
00523         }
00524 
00525         (void) devtonaddr(devname, netaddr_);
00526 
00527         state_ = PNET_PSTATE_ACTIVE;
00528 
00529         if (pcap_lookupnet(srcname_, &local_net_, &local_netmask_, errbuf_) < 0) {
00530                 fprintf(stderr,
00531                   "warning: pcap/live (%s) couldn't get local IP network info: %s\n",
00532                   name(), errbuf_) ;
00533         }
00534 #ifndef __linux__
00535         {
00536                 int immed = 1;
00537                 if (ioctl(pfd_, BIOCIMMEDIATE, &immed) < 0) {
00538                         fprintf(stderr,
00539                                 "warning: pcap/live (%s) couldn't set immed\n",
00540                                 name());
00541                         perror("ioctl(BIOCIMMEDIATE)");
00542                 }
00543         }
00544 #endif
00545         return 0;
00546 }

Here is the call graph for this function:

int PcapLiveNetwork::open int  mode  )  [protected]
 

Definition at line 649 of file net-pcap.cc.

References autodevname().

Referenced by command().

00650 {
00651         return (open(mode, autodevname()));
00652 }

Here is the call graph for this function:

int Network::parsemode const char *   )  [static, inherited]
 

Definition at line 141 of file net.cc.

Referenced by PcapFileNetwork::command(), command(), and IPNetwork::command().

00142 {
00143         if (strcmp(mname, "readonly") == 0) {
00144                 return (O_RDONLY);
00145         } else if (strcmp(mname, "readwrite") == 0) {
00146                 return (O_RDWR);
00147         } else if (strcmp(mname, "writeonly") == 0) {
00148                 return (O_WRONLY);
00149         }
00150         return (::atoi(mname));
00151 }

void PcapNetwork::phandler u_char *  u,
const pcap_pkthdr *  h,
const u_char *  p
[static, protected, inherited]
 

Definition at line 320 of file net-pcap.cc.

References pcap_singleton::hdr, and pcap_singleton::pkt.

Referenced by PcapNetwork::recv().

00321 {
00322         pcap_singleton *ps = (pcap_singleton*) userdata;
00323         ps->hdr = (pcap_pkthdr*)ph;
00324         ps->pkt = (u_char*)pkt;
00325 }

void PcapNetwork::phandler_callback u_char *  u,
const pcap_pkthdr *  h,
const u_char *  p
[static, protected, inherited]
 

Definition at line 328 of file net-pcap.cc.

References Packet::accessdata(), Packet::alloc(), pcap_singleton_callback::callback, pcap_singleton_callback::clientdata, pcap_singleton_callback::net, PcapNetwork::pcnt_, PcapNetwork::skiphdr(), and PcapNetwork::t_firstpkt_.

Referenced by PcapNetwork::recv().

00329 {
00330         pcap_singleton_callback *ps = (pcap_singleton_callback*) userdata;      
00331 
00332         Packet *p = Packet::alloc(ph->caplen);
00333         PcapNetwork *inst = ps->net;
00334         
00335         if (++(inst->pcnt_) == 1) {
00336                 // mark time stamp of first pkt
00337                 inst->t_firstpkt_ = ph->ts.tv_sec + ph->ts.tv_usec * 0.000001;
00338         }
00339 
00340         // link layer header will be placed at the beginning from pcap
00341         int s = inst->skiphdr();        // go to IP header
00342         memcpy(p->accessdata(), pkt + s, ph->caplen - s);
00343 
00344         ps->callback(ps->clientdata, p, ph->ts);
00345 }

Here is the call graph for this function:

int PcapNetwork::rchannel  )  [inline, virtual, inherited]
 

Implements Network.

Definition at line 112 of file net-pcap.cc.

References PcapNetwork::pfd_.

00112 { return(pfd_); }

int PcapNetwork::recv netpkt_handler  callback,
void *  clientdata
[virtual, inherited]
 

Reimplemented from Network.

Definition at line 398 of file net-pcap.cc.

References PcapNetwork::pcap_, PcapNetwork::phandler_callback(), PNET_PSTATE_ACTIVE, and PcapNetwork::state_.

00399 {
00400         if (state_ != PNET_PSTATE_ACTIVE) {
00401                 fprintf(stderr, "warning: net/pcap obj(%s) read-- not active\n",
00402                         name());
00403                 return -1;
00404         }
00405 
00406         int pktcnt = -1;                // all in buffer, or until error
00407         int np;                 // counts # of pkts dispatched
00408         pcap_singleton_callback ps = { callback, clientdata, this };
00409         
00410         np = pcap_dispatch(pcap_, pktcnt, phandler_callback, (u_char *)&ps);
00411 
00412 #ifdef MY_OWN_PCAP      // directly access pcap_t's member
00413         assert( pcap_->cc == 0 ); // i.e. we have emptied pcap's buffer
00414 #endif // MY_OWN_PCAP
00415         return np;
00416 }

Here is the call graph for this function:

int PcapNetwork::recv u_char *  buf,
int  len,
sockaddr &  ,
double & 
[virtual, inherited]
 

Implements Network.

Definition at line 348 of file net-pcap.cc.

References PcapNetwork::gents(), pcap_singleton::hdr, len, MIN, PcapNetwork::pcap_, PcapNetwork::pcnt_, PcapNetwork::phandler(), pcap_singleton::pkt, PNET_PSTATE_ACTIVE, PcapNetwork::skiphdr(), PcapNetwork::state_, PcapNetwork::t_firstpkt_, and ts.

00349 {
00350 
00351         if (state_ != PNET_PSTATE_ACTIVE) {
00352                 fprintf(stderr, "warning: net/pcap obj(%s) read-- not active\n",
00353                         name());
00354                 return -1;
00355         }
00356 
00357         int pktcnt = 1;         // all in buffer, or until error
00358         int np;                 // counts # of pkts dispatched
00359         pcap_singleton ps = { 0, 0 };
00360         np = pcap_dispatch(pcap_, pktcnt, phandler, (u_char*) &ps);
00361         if (np < 0) {
00362                 fprintf(stderr,
00363                         "PcapNetwork(%s): recv: pcap_dispatch: %s\n",
00364                             name(), pcap_strerror(errno));
00365                 return (np);
00366         } else if (np == 0) {
00367                 /* we get here on EOF of a Pcap/File Network */
00368                 return (np);
00369         } else if (np != pktcnt) {
00370                 fprintf(stderr,
00371                         "PcapNetwork(%s): warning: recv: pcap_dispatch: requested pktcnt (%d) doesn't match actual (%d)\n",
00372                             name(), pktcnt, np);
00373         }
00374 
00375         pcap_pkthdr* ph = ps.hdr;
00376 
00377         if (ph == NULL || ps.pkt == NULL) {
00378                 fprintf(stderr,
00379                         "PcapNetwork(%s): recv: pcap_dispatch: no packet present\n",
00380                             name());
00381                 return (-1);
00382         }
00383 
00384         if (++pcnt_ == 1) {
00385                 // mark time stamp of first pkt
00386                 t_firstpkt_ = ph->ts.tv_sec + ph->ts.tv_usec * 0.000001;
00387         }
00388 
00389         int n = MIN(ph->caplen, (unsigned)len);
00390         ts = gents(ph); // mark with timestamp
00391         // link layer header will be placed at the beginning from pcap
00392         int s = skiphdr();      // go to IP header
00393         memcpy(buf, ps.pkt + s, n - s);
00394         return n - s;
00395 }

Here is the call graph for this function:

void PcapNetwork::reset  )  [inherited]
 

Definition at line 243 of file net-pcap.cc.

References PcapNetwork::errbuf_, PcapNetwork::pcap_, PcapNetwork::pcnt_, PcapNetwork::pfd_, PNET_PSTATE_INACTIVE, PcapNetwork::srcname_, and PcapNetwork::state_.

Referenced by PcapNetwork::close(), and PcapLiveNetwork().

00244 {
00245         state_ = PNET_PSTATE_INACTIVE;
00246         pfd_ = -1;
00247         pcap_ = NULL;
00248         *errbuf_ = '\0';
00249         *srcname_ = '\0';
00250         pcnt_ = 0;
00251 }

int PcapNetwork::schannel  )  [inline, virtual, inherited]
 

Implements Network.

Definition at line 113 of file net-pcap.cc.

References PcapNetwork::pfd_.

00113 { return(pfd_); }

int PcapNetwork::send u_char *  buf,
int  len
[virtual, inherited]
 

Implements Network.

Definition at line 420 of file net-pcap.cc.

References len, and PcapNetwork::pfd_.

00421 {
00422         int n;
00423 
00424         if ((n = write(pfd_, buf, len)) < 0)
00425                 perror("write to pcap fd");
00426 
00427         return n;
00428 }

int PcapLiveNetwork::skiphdr  )  [protected, virtual]
 

Implements PcapNetwork.

Definition at line 553 of file net-pcap.cc.

References dlink_type_, and ETHER_HDR_LEN.

00554 {
00555         switch (dlink_type_) {
00556         case DLT_NULL:
00557                 return 0;
00558 
00559         case DLT_EN10MB:
00560                 return ETHER_HDR_LEN;
00561 
00562         default:
00563                 fprintf(stderr,
00564                     "Network/Pcap/Live(%s): unknown link type: %d\n",
00565                         name(), dlink_type_);
00566         }
00567         return -1;
00568 }

int PcapNetwork::stat_pdrops  )  [inherited]
 

Definition at line 293 of file net-pcap.cc.

References PcapNetwork::pcap_, and PcapNetwork::pcs_.

Referenced by PcapNetwork::command().

00294 {
00295         if (pcap_stats(pcap_, &pcs_) < 0)
00296                 return (-1);
00297 
00298         return (pcs_.ps_drop);
00299 }

int PcapNetwork::stat_pkts  )  [inherited]
 

Definition at line 283 of file net-pcap.cc.

References PcapNetwork::pcap_, and PcapNetwork::pcs_.

Referenced by PcapNetwork::command().

00284 {
00285         if (pcap_stats(pcap_, &pcs_) < 0)
00286                 return (-1);
00287 
00288         return (pcs_.ps_recv);
00289 }


Member Data Documentation

struct bpf_program PcapNetwork::bpfpgm_ [protected, inherited]
 

Definition at line 144 of file net-pcap.cc.

Referenced by PcapNetwork::filter().

int PcapLiveNetwork::dlink_type_ [protected]
 

Definition at line 189 of file net-pcap.cc.

Referenced by open(), PcapLiveNetwork(), and skiphdr().

char PcapNetwork::errbuf_[PCAP_ERRBUF_SIZE] [protected, inherited]
 

Definition at line 137 of file net-pcap.cc.

Referenced by autodevname(), PcapFileNetwork::open(), open(), and PcapNetwork::reset().

NetworkAddress PcapLiveNetwork::linkaddr_ [protected]
 

Definition at line 185 of file net-pcap.cc.

Referenced by command(), laddr(), open(), and PcapLiveNetwork().

unsigned int PcapLiveNetwork::local_net_ [protected]
 

Definition at line 188 of file net-pcap.cc.

Referenced by open(), and PcapLiveNetwork().

unsigned int PcapNetwork::local_netmask_ [protected, inherited]
 

Definition at line 147 of file net-pcap.cc.

Referenced by PcapNetwork::filter(), open(), and PcapNetwork::PcapNetwork().

int Network::mode_ [protected, inherited]
 

Definition at line 76 of file net.h.

Referenced by UDPIPNetwork::bind(), Network::command(), UDPIPNetwork::connect(), Network::mode(), Network::Network(), PcapFileNetwork::open(), open(), IPNetwork::open(), UDPIPNetwork::open(), IPNetwork::recv(), and IPNetwork::reset().

NetworkAddress PcapLiveNetwork::netaddr_ [protected]
 

Definition at line 186 of file net-pcap.cc.

Referenced by command(), naddr(), open(), and PcapLiveNetwork().

double PcapNetwork::offset_ [inherited]
 

Definition at line 129 of file net-pcap.cc.

Referenced by PcapFileNetwork::bindvars(), bindvars(), and PcapFileNetwork::gents().

int PcapNetwork::optimize_ [protected, inherited]
 

Definition at line 142 of file net-pcap.cc.

Referenced by PcapNetwork::bindvars(), and PcapNetwork::filter().

pcap_t* PcapNetwork::pcap_ [protected, inherited]
 

Definition at line 143 of file net-pcap.cc.

Referenced by PcapNetwork::close(), PcapNetwork::filter(), PcapFileNetwork::open(), open(), PcapNetwork::recv(), PcapNetwork::reset(), PcapNetwork::stat_pdrops(), and PcapNetwork::stat_pkts().

int PcapNetwork::pcnt_ [protected, inherited]
 

Definition at line 140 of file net-pcap.cc.

Referenced by PcapNetwork::PcapNetwork(), PcapNetwork::phandler_callback(), PcapNetwork::recv(), and PcapNetwork::reset().

struct pcap_stat PcapNetwork::pcs_ [protected, inherited]
 

Definition at line 145 of file net-pcap.cc.

Referenced by PcapNetwork::stat_pdrops(), and PcapNetwork::stat_pkts().

int PcapNetwork::pfd_ [protected, inherited]
 

Definition at line 139 of file net-pcap.cc.

Referenced by PcapFileNetwork::open(), open(), PcapNetwork::PcapNetwork(), PcapNetwork::rchannel(), PcapNetwork::reset(), PcapNetwork::schannel(), and PcapNetwork::send().

int PcapLiveNetwork::promisc_ [protected]
 

Definition at line 183 of file net-pcap.cc.

Referenced by bindvars(), and open().

int PcapLiveNetwork::snaplen_ [protected]
 

Definition at line 182 of file net-pcap.cc.

Referenced by bindvars(), and open().

char PcapNetwork::srcname_[PATH_MAX] [protected, inherited]
 

Definition at line 138 of file net-pcap.cc.

Referenced by command(), PcapNetwork::command(), PcapFileNetwork::open(), open(), and PcapNetwork::reset().

int PcapNetwork::state_ [protected, inherited]
 

Definition at line 141 of file net-pcap.cc.

Referenced by PcapNetwork::close(), PcapNetwork::command(), PcapFileNetwork::open(), open(), PcapNetwork::recv(), and PcapNetwork::reset().

double PcapNetwork::t_firstpkt_ [inherited]
 

Definition at line 130 of file net-pcap.cc.

Referenced by PcapFileNetwork::gents(), PcapNetwork::PcapNetwork(), PcapNetwork::phandler_callback(), and PcapNetwork::recv().

double PcapLiveNetwork::timeout_ [protected]
 

Definition at line 184 of file net-pcap.cc.

Referenced by bindvars(), and open().


The documentation for this class was generated from the following file:
Generated on Tue Apr 20 13:07:11 2004 for NS2.26SourcesOriginal by doxygen 1.3.3