diff --git a/headers/header_spec.txt b/headers/header_spec.txt index 7a5d5138ee15f2eb3a3935ab37c82d596fdd2abb..4c33aba539b7f8afe6bf137ad3e8d23e07830666 100644 --- a/headers/header_spec.txt +++ b/headers/header_spec.txt @@ -252,6 +252,7 @@ share/libc/n1362.pdf: .ignore share/libc/net/if.h: CEA_LGPL share/libc/netdb.c: CEA_LGPL share/libc/netdb.h: CEA_LGPL +share/libc/netinet/in.c: CEA_LGPL share/libc/netinet/in.h: CEA_LGPL share/libc/netinet/ip.h: CEA_LGPL share/libc/netinet/tcp.h: CEA_LGPL diff --git a/share/libc/__fc_inet.h b/share/libc/__fc_inet.h index 5904cd5fff16da2ee40276eb02bdac5d8a5d6a7a..a3d3a750b6343eb36ed1b1e1446dbcd089060295 100644 --- a/share/libc/__fc_inet.h +++ b/share/libc/__fc_inet.h @@ -83,11 +83,8 @@ struct sockaddr_in6 { // Not required by POSIX #define INADDR_LOOPBACK (uint32_t)0x7F000001 -const struct in6_addr in6addr_any={{0}}; -const struct in6_addr in6addr_loopback= - {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, - 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}} - ; +extern const struct in6_addr in6addr_any; +extern const struct in6_addr in6addr_loopback; struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; diff --git a/share/libc/__fc_runtime.c b/share/libc/__fc_runtime.c index 6c9dff3a43253b26f03383e547ca4ad30a721faa..fc29185b4ed23085903529b90f0bf401b98674c4 100644 --- a/share/libc/__fc_runtime.c +++ b/share/libc/__fc_runtime.c @@ -31,6 +31,7 @@ #include "locale.c" #include "math.c" #include "netdb.c" +#include "netinet/in.c" #include "signal.c" #include "stdio.c" #include "stdlib.c" diff --git a/share/libc/netinet/in.c b/share/libc/netinet/in.c new file mode 100644 index 0000000000000000000000000000000000000000..cc893c285e3afe901b8a516d2abc8f79476b2d8e --- /dev/null +++ b/share/libc/netinet/in.c @@ -0,0 +1,29 @@ +/**************************************************************************/ +/* */ +/* This file is part of Frama-C. */ +/* */ +/* Copyright (C) 2007-2021 */ +/* CEA (Commissariat à l'énergie atomique et aux énergies */ +/* alternatives) */ +/* */ +/* you can redistribute it and/or modify it under the terms of the GNU */ +/* Lesser General Public License as published by the Free Software */ +/* Foundation, version 2.1. */ +/* */ +/* It is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU Lesser General Public License for more details. */ +/* */ +/* See the GNU Lesser General Public License version 2.1 */ +/* for more details (enclosed in the file licenses/LGPLv2.1). */ +/* */ +/**************************************************************************/ + +#include "in.h" + +const struct in6_addr in6addr_any={{0}}; +const struct in6_addr in6addr_loopback= + {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}} + ;