"Fossies" - the Fresh Open Source Software Archive

Member "portfwd-0.29/src/host_map.hpp" (7 May 2002, 1122 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   host_map.hpp
    3 
    4   $Id: host_map.hpp,v 1.6 2002/05/07 03:15:36 evertonm Exp $
    5  */
    6 
    7 #ifndef HOST_MAP_HPP
    8 #define HOST_MAP_HPP
    9 
   10 #include <stdio.h>
   11 
   12 #include "vector.hpp"
   13 #include "from_addr.hpp"
   14 #include "to_addr.hpp"
   15 
   16 class host_map
   17 {
   18 private:
   19   vector<from_addr*> *src_list;
   20   vector<to_addr*>   *dst_list;
   21   int next_dst_index;
   22 
   23 public:
   24   host_map(vector<from_addr*> *src, vector<to_addr*> *dst)
   25     {
   26       src_list = src;
   27       dst_list = dst;
   28       next_dst_index = 0;
   29     }
   30 
   31   void show() const;
   32 
   33   int pipe(int *sd, const struct sockaddr_in *cli_sa,   
   34        unsigned int cli_sa_len, const struct ip_addr *ip, 
   35        int port, const struct ip_addr *src,     
   36        const struct sockaddr_in *local_cli_sa);
   37 
   38   void udp_forward(const struct ip_addr *source, 
   39            const struct sockaddr_in *cli_sa, 
   40            const struct sockaddr_in *local_cli_sa,
   41            const struct ip_addr *ip, int port, 
   42            const char *buf, int buf_len);
   43 
   44   int tcp_match(const struct ip_addr *ip, int port) const;
   45   int udp_match(const struct ip_addr *ip, int port, const char *buf, int buf_len) const;
   46 };
   47 
   48 #endif /* HOST_MAP_HPP */
   49 
   50 /* Eof: host_map.hpp */