"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/src/port_pair.cc" (15 May 2001, 389 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   port_pair.cc
    3 
    4   $Id: port_pair.cc,v 1.1.1.1 2001/05/15 00:24:59 evertonm Exp $
    5  */
    6 
    7 #include <syslog.h>
    8 #include "port_pair.h"
    9 
   10 port_pair::port_pair(int p1, int p2)
   11 {
   12   first = p1;
   13   last  = p2;
   14 }
   15 
   16 void port_pair::show() const
   17 {
   18   syslog(LOG_INFO, "%d+%d", first, last);
   19 }
   20 
   21 int port_pair::match(int port) const
   22 {
   23   return (port >= first) && (port <= last);
   24 }
   25 
   26 /* Eof: port_pair.cc */