"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/src/from_addr.cc" (15 May 2001, 541 Bytes) of package /linux/privat/old/portfwd-0.29.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2   from_addr.c
    3 
    4   $Id: from_addr.cc,v 1.1.1.1 2001/05/15 00:24:58 evertonm Exp $
    5  */
    6 
    7 #include <syslog.h>
    8 #include "from_addr.hpp"
    9 
   10 void from_addr::show() const
   11 {
   12   np->show();
   13   syslog(LOG_INFO, ":");
   14   pp->show();
   15 }
   16 
   17 /*
   18  * Returns 0 on failure.
   19  */
   20 int from_addr::match(const struct ip_addr *ip, int port) const
   21 {
   22   /*
   23   syslog(LOG_DEBUG, "? %s:%d", addrtostr(ip), port);
   24   np->show();
   25   pp->show();
   26   syslog(LOG_DEBUG, "> %d %d", np->owns(ip), pp->match(port));
   27   */
   28 
   29   return pp->match(port) && np->owns(ip);
   30 }
   31 
   32 /* Eof: from_addr.c */