Was throwing a compilation warning in FreeBSD.
#include "address.h"
-#include <string.h>
-#include <errno.h>
-#include <arpa/inet.h> /* inet_ntop */
-#include <sys/types.h> /* AF_INET, AF_INET6 (needed in OpenBSD) */
-#include <sys/socket.h> /* AF_INET, AF_INET6 (needed in OpenBSD) */
-#include "common.h"
+#include <stdlib.h> /* strtoul() */
+#include <string.h> /* memset(), memcpy() */
+#include <arpa/inet.h> /* inet_ntop(), htonl() */
+
#include "log.h"
#include "thread_var.h"
return true;
}
+char const *
+addr2str4(struct in_addr const *addr, char *buffer)
+{
+ return inet_ntop(AF_INET, addr, buffer, INET_ADDRSTRLEN);
+}
+
+char const *
+addr2str6(struct in6_addr const *addr, char *buffer)
+{
+ return inet_ntop(AF_INET6, addr, buffer, INET6_ADDRSTRLEN);
+}
+
/**
* buffer must length INET6_ADDRSTRLEN.
*/
bool ipv4_covered(struct in_addr *, uint8_t, struct in_addr *);
bool ipv6_covered(struct in6_addr *, uint8_t, struct in6_addr *);
+char const *addr2str4(struct in_addr const *, char *);
+char const *addr2str6(struct in6_addr const *, char *);
void sockaddr2str(struct sockaddr_storage *, char *buffer);
#endif /* SRC_ADDRESS_H_ */
#include "common.h"
-#include <errno.h>
-#include <dirent.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <arpa/inet.h>
-#include <sys/types.h> /* AF_INET, AF_INET6 (needed in OpenBSD) */
-#include <sys/socket.h> /* AF_INET, AF_INET6 (needed in OpenBSD) */
-#include <sys/stat.h>
+#include <dirent.h> /* readdir(), closedir() */
+#include <limits.h> /* realpath() */
+#include <stdlib.h> /* malloc(), free(), realloc(), realpath() */
+#include <stdio.h> /* remove() */
+#include <string.h> /* strdup(), strrchr(), strcmp(), strcat(), etc */
+#include <unistd.h> /* stat(), rmdir() */
+#include <sys/stat.h> /* stat(), mkdir() */
+#include <sys/types.h> /* stat(), closedir(), mkdir() */
#include "config.h"
#include "log.h"
return result;
}
-char const *
-addr2str4(struct in_addr const *addr, char *buffer)
-{
- return inet_ntop(AF_INET, addr, buffer, INET_ADDRSTRLEN);
-}
-
-char const *
-addr2str6(struct in6_addr const *addr, char *buffer)
-{
- return inet_ntop(AF_INET6, addr, buffer, INET6_ADDRSTRLEN);
-}
-
static int
dir_exists(char const *path, bool *result)
{
#include <pthread.h>
#include <stdbool.h>
#include <time.h>
-#include <netinet/in.h>
/* "I think that this is not supposed to be implemented." */
#define ENOTSUPPORTED 3172
typedef int (*pr_errno_cb)(int, const char *, ...);
bool valid_file_or_dir(char const *, bool, bool, pr_errno_cb);
-char const *addr2str4(struct in_addr const *, char *);
-char const *addr2str6(struct in6_addr const *, char *);
-
int create_dir_recursive(char const *);
int delete_dir_recursive_bottom_up(char const *);
get_certificate_type(X509 *cert, bool is_ta, enum cert_type *result)
{
if (is_ta) {
- /* Note: It looks weird if we log the type here. */
*result = TA;
return 0;
}
if (X509_check_ca(cert) == 1) {
- pr_val_debug("Type: CA");
*result = CA;
return 0;
}
if (has_bgpsec_router_eku(cert)) {
- pr_val_debug("Type: BGPsec EE");
*result = BGPSEC;
return 0;
}