if (FD_ISSET(this->ipv4, &rfds))
{
- port = IKEV2_UDP_PORT;
+ port = CHARON_UDP_PORT;
selected = this->ipv4;
}
if (FD_ISSET(this->ipv4_natt, &rfds))
{
- port = IKEV2_NATT_PORT;
+ port = CHARON_NATT_PORT;
selected = this->ipv4_natt;
}
if (FD_ISSET(this->ipv6, &rfds))
{
- port = IKEV2_UDP_PORT;
+ port = CHARON_UDP_PORT;
selected = this->ipv6;
}
if (FD_ISSET(this->ipv6_natt, &rfds))
{
- port = IKEV2_NATT_PORT;
+ port = CHARON_NATT_PORT;
selected = this->ipv6_natt;
}
if (selected)
DBG2(DBG_NET, "received packet: from %#H to %#H", source, dest);
data_offset = 0;
/* remove non esp marker */
- if (dest->get_port(dest) == IKEV2_NATT_PORT)
+ if (dest->get_port(dest) == CHARON_NATT_PORT)
{
data_offset += MARKER_LEN;
}
/* send data */
sport = src->get_port(src);
family = dst->get_family(dst);
- if (sport == IKEV2_UDP_PORT)
+ if (sport == CHARON_UDP_PORT)
{
if (family == AF_INET)
{
skt = this->ipv6;
}
}
- else if (sport == IKEV2_NATT_PORT)
+ else if (sport == CHARON_NATT_PORT)
{
if (family == AF_INET)
{
{
/* enable UDP decapsulation globally, only for one socket needed */
int type = UDP_ENCAP_ESPINUDP;
- if (family == AF_INET && port == IKEV2_NATT_PORT &&
+ if (family == AF_INET && port == CHARON_NATT_PORT &&
setsockopt(skt, SOL_UDP, UDP_ENCAP, &type, sizeof(type)) < 0)
{
DBG1(DBG_NET, "unable to set UDP_ENCAP: %s", strerror(errno));
#ifdef __APPLE__
{
- int natt_port = IKEV2_NATT_PORT;
+ int natt_port = CHARON_NATT_PORT;
if (sysctlbyname("net.inet.ipsec.esp_port", NULL, NULL, &natt_port,
sizeof(natt_port)) != 0)
{
}
#endif
- this->ipv4 = open_socket(this, AF_INET, IKEV2_UDP_PORT);
+ this->ipv4 = open_socket(this, AF_INET, CHARON_UDP_PORT);
if (this->ipv4 == 0)
{
DBG1(DBG_NET, "could not open IPv4 socket, IPv4 disabled");
}
else
{
- this->ipv4_natt = open_socket(this, AF_INET, IKEV2_NATT_PORT);
+ this->ipv4_natt = open_socket(this, AF_INET, CHARON_NATT_PORT);
if (this->ipv4_natt == 0)
{
DBG1(DBG_NET, "could not open IPv4 NAT-T socket");
}
}
- this->ipv6 = open_socket(this, AF_INET6, IKEV2_UDP_PORT);
+ this->ipv6 = open_socket(this, AF_INET6, CHARON_UDP_PORT);
if (this->ipv6 == 0)
{
DBG1(DBG_NET, "could not open IPv6 socket, IPv6 disabled");
}
else
{
- this->ipv6_natt = open_socket(this, AF_INET6, IKEV2_NATT_PORT);
+ this->ipv6_natt = open_socket(this, AF_INET6, CHARON_NATT_PORT);
if (this->ipv6_natt == 0)
{
DBG1(DBG_NET, "could not open IPv6 NAT-T socket");