diff options
author | Yves-Alexis Perez <corsac@debian.org> | 2016-07-16 15:19:53 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@debian.org> | 2016-07-16 15:19:53 +0200 |
commit | bf372706c469764d59e9f29c39e3ecbebd72b8d2 (patch) | |
tree | 0f0e296e2d50e4a7faf99ae6fa428d2681e81ea1 /src/libcharon/plugins/socket_default | |
parent | 518dd33c94e041db0444c7d1f33da363bb8e3faf (diff) | |
download | vyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.tar.gz vyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.zip |
Imported Upstream version 5.5.0
Diffstat (limited to 'src/libcharon/plugins/socket_default')
-rw-r--r-- | src/libcharon/plugins/socket_default/Makefile.in | 27 | ||||
-rw-r--r-- | src/libcharon/plugins/socket_default/socket_default_socket.c | 32 |
2 files changed, 37 insertions, 22 deletions
diff --git a/src/libcharon/plugins/socket_default/Makefile.in b/src/libcharon/plugins/socket_default/Makefile.in index 3dcfaf4a6..112d8d218 100644 --- a/src/libcharon/plugins/socket_default/Makefile.in +++ b/src/libcharon/plugins/socket_default/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -79,8 +89,6 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/libcharon/plugins/socket_default -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \ $(top_srcdir)/m4/config/ltoptions.m4 \ @@ -94,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = @@ -203,12 +212,14 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ +ATOMICLIB = @ATOMICLIB@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -258,6 +269,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -292,6 +304,7 @@ PTHREADLIB = @PTHREADLIB@ PYTHON = @PYTHON@ PYTHONEGGINSTALLDIR = @PYTHONEGGINSTALLDIR@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PACKAGE_VERSION = @PYTHON_PACKAGE_VERSION@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ @@ -403,6 +416,7 @@ random_device = @random_device@ resolv_conf = @resolv_conf@ routing_table = @routing_table@ routing_table_prio = @routing_table_prio@ +runstatedir = @runstatedir@ s_plugins = @s_plugins@ sbindir = @sbindir@ scepclient_plugins = @scepclient_plugins@ @@ -462,7 +476,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libcharon/plugins/socket_default/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/libcharon/plugins/socket_default/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -776,6 +789,8 @@ uninstall-am: uninstall-pluginLTLIBRARIES mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pluginLTLIBRARIES +.PRECIOUS: Makefile + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/libcharon/plugins/socket_default/socket_default_socket.c b/src/libcharon/plugins/socket_default/socket_default_socket.c index 6e432d9cf..ba22b0c2b 100644 --- a/src/libcharon/plugins/socket_default/socket_default_socket.c +++ b/src/libcharon/plugins/socket_default/socket_default_socket.c @@ -84,12 +84,12 @@ struct private_socket_default_socket_t { /** * Configured port (or random, if initially 0) */ - u_int16_t port; + uint16_t port; /** * Configured port for NAT-T (or random, if initially 0) */ - u_int16_t natt; + uint16_t natt; /** * IPv4 socket (500 or port) @@ -114,22 +114,22 @@ struct private_socket_default_socket_t { /** * DSCP value set on IPv4 socket */ - u_int8_t dscp4; + uint8_t dscp4; /** * DSCP value set on IPv4 socket for NAT-T (4500 or natt) */ - u_int8_t dscp4_natt; + uint8_t dscp4_natt; /** * DSCP value set on IPv6 socket (500 or port) */ - u_int8_t dscp6; + uint8_t dscp6; /** * DSCP value set on IPv6 socket for NAT-T (4500 or natt) */ - u_int8_t dscp6_natt; + uint8_t dscp6_natt; /** * Maximum packet size to receive @@ -153,7 +153,7 @@ struct private_socket_default_socket_t { */ #ifdef IP_PKTINFO -static host_t *get_dst_v4(struct cmsghdr *cmsgptr, u_int16_t port) +static host_t *get_dst_v4(struct cmsghdr *cmsgptr, uint16_t port) { struct sockaddr_in dst = { .sin_family = AF_INET, @@ -174,7 +174,7 @@ static host_t *get_dst_v4(struct cmsghdr *cmsgptr, u_int16_t port) #elif defined(IP_RECVDSTADDR) -static host_t *get_dst_v4(struct cmsghdr *cmsgptr, u_int16_t port) +static host_t *get_dst_v4(struct cmsghdr *cmsgptr, uint16_t port) { struct sockaddr_in dst = { .sin_family = AF_INET, @@ -193,7 +193,7 @@ static host_t *get_dst_v4(struct cmsghdr *cmsgptr, u_int16_t port) #else /* IP_PKTINFO || IP_RECVDSTADDR */ -static host_t *get_dst_v4(struct cmsghdr *cmsgptr, u_int16_t port) +static host_t *get_dst_v4(struct cmsghdr *cmsgptr, uint16_t port) { return NULL; } @@ -206,7 +206,7 @@ static host_t *get_dst_v4(struct cmsghdr *cmsgptr, u_int16_t port) */ #ifdef HAVE_IN6_PKTINFO -static host_t *get_dst_v6(struct cmsghdr *cmsgptr, u_int16_t port) +static host_t *get_dst_v6(struct cmsghdr *cmsgptr, uint16_t port) { struct in6_pktinfo *pktinfo; struct sockaddr_in6 dst = { @@ -225,7 +225,7 @@ static host_t *get_dst_v6(struct cmsghdr *cmsgptr, u_int16_t port) #else /* HAVE_IN6_PKTINFO */ -static host_t *get_dst_v6(struct cmsghdr *cmsgptr, u_int16_t port) +static host_t *get_dst_v6(struct cmsghdr *cmsgptr, uint16_t port) { return NULL; } @@ -241,7 +241,7 @@ METHOD(socket_t, receiver, status_t, host_t *source = NULL, *dest = NULL; int i, rr, index, bytes_read = 0, selected = -1; bool oldstate; - u_int16_t port = 0; + uint16_t port = 0; struct pollfd pfd[] = { { .fd = this->ipv4, .events = POLLIN }, { .fd = this->ipv4_natt, .events = POLLIN }, @@ -464,7 +464,7 @@ METHOD(socket_t, sender, status_t, host_t *src, *dst; struct msghdr msg; struct iovec iov; - u_int8_t *dscp; + uint8_t *dscp; src = packet->get_source(packet); dst = packet->get_destination(packet); @@ -521,7 +521,7 @@ METHOD(socket_t, sender, status_t, { if (family == AF_INET) { - u_int8_t ds4; + uint8_t ds4; ds4 = packet->get_dscp(packet) << 2; if (setsockopt(skt, SOL_IP, IP_TOS, &ds4, sizeof(ds4)) == 0) @@ -584,7 +584,7 @@ METHOD(socket_t, sender, status_t, return SUCCESS; } -METHOD(socket_t, get_port, u_int16_t, +METHOD(socket_t, get_port, uint16_t, private_socket_default_socket_t *this, bool nat_t) { return nat_t ? this->natt : this->port; @@ -610,7 +610,7 @@ METHOD(socket_t, supported_families, socket_family_t, * open a socket to send and receive packets */ static int open_socket(private_socket_default_socket_t *this, - int family, u_int16_t *port) + int family, uint16_t *port) { int on = TRUE; union { |