"Fossies" - the Fresh Open Source Software Archive 
Member "portfwd-0.29/src/dst_addr.cc" (7 May 2002, 700 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 dst_addr.cc
3
4 $Id: dst_addr.cc,v 1.3 2002/05/07 03:15:36 evertonm Exp $
5 */
6
7 #include <syslog.h>
8 #include <stdlib.h>
9 #include <string.h>
10
11 #include "util.h"
12 #include "addr.h"
13 #include "dst_addr.hpp"
14 #include "solve.h"
15
16 void dst_addr::show() const
17 {
18 show_addr(&address);
19 syslog(LOG_INFO, ":%d", port);
20 }
21
22 int dst_addr::get_addr(const char *protoname,
23 const struct sockaddr_in *cli_sa,
24 const struct sockaddr_in *local_cli_sa,
25 const struct ip_addr **addr, int *prt)
26 {
27 if (name) {
28 free(address.addr);
29 struct ip_addr ad = solve_hostname(name);
30 memcpy((void *) &address, (void *) &ad, sizeof(ad));
31 }
32
33 *addr = &address;
34 *prt = port;
35
36 return 0;
37 }
38
39 /* Eof: dst_addr.cc */