"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/src/addr.cc" (5 May 2002, 462 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   addr.c
    3 
    4   $Id: addr.cc,v 1.2 2002/05/05 08:55:52 evertonm Exp $
    5  */
    6 
    7 #include <sys/types.h>
    8 #include <sys/socket.h>
    9 #include <netinet/in.h>
   10 #include <arpa/inet.h>
   11 #include <syslog.h>
   12 #include <stdio.h>
   13 
   14 #include "addr.h"
   15 
   16 const int addr_len = 4;
   17 
   18 const char *addrtostr(const struct ip_addr *ip)
   19 {
   20   return inet_ntoa(*((struct in_addr *) ip->addr));
   21 }
   22 
   23 void show_addr(const struct ip_addr *ip)
   24 {
   25   syslog(LOG_INFO, "%s", addrtostr(ip));
   26 }
   27 
   28 /* Eof: addr.c */