version 1.2, 2005/06/14 12:18:24 |
version 1.3, 2016/12/10 05:43:11 |
Line 31 __RCSID("$NetBSD$"); |
|
Line 31 __RCSID("$NetBSD$"); |
|
#include "identd.h" |
#include "identd.h" |
|
|
int |
int |
ipf_natlookup(struct sockaddr_storage *ss, struct sockaddr *nat_addr, |
ipf_natlookup(const struct sockaddr_storage *ss, |
int *nat_lport) |
struct sockaddr_storage *nat_addr, in_port_t *nat_lport) |
{ |
{ |
natlookup_t nl; |
natlookup_t nl; |
ipfobj_t obj; |
ipfobj_t obj; |
Line 50 ipf_natlookup(struct sockaddr_storage *s |
|
Line 50 ipf_natlookup(struct sockaddr_storage *s |
|
/* Build the ipf natlook structure. */ |
/* Build the ipf natlook structure. */ |
switch (ss[0].ss_family) { |
switch (ss[0].ss_family) { |
case AF_INET: |
case AF_INET: |
(void)memcpy(&nl.nl_realip, &satosin(&ss[0])->sin_addr, |
(void)memcpy(&nl.nl_realip, &csatosin(&ss[0])->sin_addr, |
sizeof(struct in_addr)); |
sizeof(struct in_addr)); |
(void)memcpy(&nl.nl_outip, &satosin(&ss[1])->sin_addr, |
(void)memcpy(&nl.nl_outip, &csatosin(&ss[1])->sin_addr, |
sizeof(struct in_addr)); |
sizeof(struct in_addr)); |
nl.nl_realport = ntohs(satosin(&ss[0])->sin_port); |
nl.nl_realport = ntohs(csatosin(&ss[0])->sin_port); |
nl.nl_outport = ntohs(satosin(&ss[1])->sin_port); |
nl.nl_outport = ntohs(csatosin(&ss[1])->sin_port); |
nl.nl_flags = IPN_TCP | IPN_IN; |
nl.nl_flags = IPN_TCP | IPN_IN; |
break; |
break; |
case AF_INET6: |
case AF_INET6: |