# Android build system default cofig
env.AppendUnique(CPPDEFINES = ['ANDROID'])
+env.AppendUnique(CFLAGS = ['-std=c99'])
env.AppendUnique(SHCFLAGS = ['-Wa,--noexecstack'])
env.AppendUnique(LINKFLAGS = ['-Wl,--gc-sections', '-Wl,-z,nocopyreloc'])
env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__'])
+env.AppendUnique(CFLAGS = ['-std=c99'])
env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
*
******************************************************************/
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to random() and srandom()
+// For details on compatibility and glibc support,
+// Refer http://www.gnu.org/software/libc/manual/html_node/BSD-Random.html
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
*
******************************************************************/
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to random()
+// For details on compatibility and glibc support,
+// Refer http://www.gnu.org/software/libc/manual/html_node/BSD-Random.html
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
* limitations under the License.
*
******************************************************************/
+
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to inet_aton
+// For details on compatibility support,
+// Refer http://man7.org/linux/man-pages/man3/inet.3.html
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+
#include "caethernetinterface.h"
#include <sys/types.h>
*
******************************************************************/
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to IFF_LOOPBACK
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+#include <net/if.h>
+
#include "caethernetinterface.h"
#include <sys/types.h>
#include <ifaddrs.h>
-#include <net/if.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
+#include <strings.h>
#include <errno.h>
#include "caadapterutils.h"
* limitations under the License.
*
******************************************************************/
+
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to struct ip_mreq
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+#include <netinet/in.h>
+
#include "caethernetinterface.h"
#include <sys/types.h>
#include <fcntl.h>
#include <sys/select.h>
#include <arpa/inet.h>
-#include <netinet/in.h>
+#include <string.h>
+
#include <errno.h>
#include "pdu.h"
* limitations under the License.
*
******************************************************************/
+
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to random() and inet_aton()
+// For details on compatibility and glibc support,
+// Refer http://man7.org/linux/man-pages/man3/inet.3.html
+// Refer http://man7.org/linux/man-pages/man3/random.3.html
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+
#include "cawifiinterface.h"
#include <sys/types.h>
*
******************************************************************/
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to IFF_LOOPBACK
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+#include <net/if.h>
+
#include "cawifiinterface.h"
#include <sys/types.h>
* limitations under the License.
*
******************************************************************/
+
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
+// Defining _BSD_SOURCE or _DEFAULT_SOURCE causes header files to expose
+// definitions that may otherwise be skipped. Skipping can cause implicit
+// declaration warnings and/or bugs and subtle problems in code execution.
+// For glibc information on feature test macros,
+// Refer http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+//
+// This file requires #define use due to struct ip_mreq
+#define _DEFAULT_SOURCE
+#define _BSD_SOURCE
+#include <netinet/in.h>
+
#include "cawifiinterface.h"
#include <sys/types.h>
#include "config.h"
#endif
+#ifdef __linux__
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
* Plug-in descriptor loader
*/
+#ifdef __linux__
+#ifndef _POSIX_C_SOURCE
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#define _POSIX_C_SOURCE 200809L
+#endif
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
* Plug-in scanning functionality
*/
+#ifdef __linux__
+#ifndef _POSIX_C_SOURCE
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#define _POSIX_C_SOURCE 200809L
+#endif
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
* Dynamic plug-in symbols
*/
+#ifdef __linux__
+#ifndef _POSIX_C_SOURCE
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#define _POSIX_C_SOURCE 200809L
+#endif
+#endif
+
#include <stdlib.h>
#include <string.h>
#include <assert.h>
POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef _POSIX_C_SOURCE
+// Defining _POSIX_C_SOURCE macro with 200809L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2008 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2008 base specification,
+// Refer http://pubs.opengroup.org/stage7tc1/
+//
+// For this specific file, see use of strndup,
+// Refer http://man7.org/linux/man-pages/man3/strdup.3.html
+#define _POSIX_C_SOURCE 200809L
+#endif
+
#include "config.h"
#include <stdlib.h>
POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef _POSIX_C_SOURCE
+// Defining _POSIX_C_SOURCE macro with 200112L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2001 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2001 base specification,
+// Refer http://pubs.opengroup.org/onlinepubs/009695399/
+//
+// For this specific file, see use of pselect,
+// Refer http://man7.org/linux/man-pages/man2/select.2.html
+#define _POSIX_C_SOURCE 200112L // Needed for pselect
+#endif
+
#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
+#include <strings.h>
#ifndef WIN32
#include <sys/select.h>
#include <sys/time.h>
POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef _POSIX_C_SOURCE
+// Defining _POSIX_C_SOURCE macro with 200112L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1-2001 base
+// specification (excluding the XSI extension).
+// For POSIX.1-2001 base specification,
+// Refer http://pubs.opengroup.org/onlinepubs/009695399/
+//
+// For this specific file, see use of getaddrinfo & structs,
+// Refer http://man7.org/linux/man-pages/man3/getaddrinfo.3.html
+#define _POSIX_C_SOURCE 200112L // needed for getaddrinfo & structs
+#endif
+
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef _POSIX_C_SOURCE
+// Defining _POSIX_C_SOURCE macro with 199309L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1b, Real-time extensions
+// (IEEE Std 1003.1b-1993) specification
+//
+// For this specific file, see use of clock_gettime,
+// Refer http://man7.org/linux/man-pages/man2/clock_gettime.2.html
+#define _POSIX_C_SOURCE 199309L // needed for clock_gettime
+#endif
+
#ifdef __APPLE__
#include <mach/mach.h>
#include <mach/mach_time.h>
#endif
#include <string.h>
+#include <strings.h>
#include <openssl/conf.h>
#include <openssl/x509v3.h>
#include <openssl/ssl.h>