Remove destiny header dependency from net_help

This commit is contained in:
Martin Lenders 2014-02-08 00:28:32 +01:00
parent 3ba156883b
commit e5df49dc5e
5 changed files with 30 additions and 4 deletions

View File

@ -18,8 +18,6 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include "destiny/socket.h"
#include "inet_ntop.h" #include "inet_ntop.h"
/* const char * /* const char *

View File

@ -18,8 +18,6 @@
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include "destiny/socket.h"
#include "inet_pton.h" #include "inet_pton.h"
/* int /* int

View File

@ -41,7 +41,9 @@ typedef uint32_t socklen_t; ///< POSIX compatible type for address length.
#define AF_UNSPEC 0 ///< unspecified address family. #define AF_UNSPEC 0 ///< unspecified address family.
#define AF_LOCAL 1 ///< local to host (pipes, portals) address family. #define AF_LOCAL 1 ///< local to host (pipes, portals) address family.
#define AF_UNIX AF_LOCAL ///< alias for AF_LOCAL for backward compatibility. #define AF_UNIX AF_LOCAL ///< alias for AF_LOCAL for backward compatibility.
#ifndef AF_INET
#define AF_INET 2 ///< internetwork address family: UDP, TCP, etc. #define AF_INET 2 ///< internetwork address family: UDP, TCP, etc.
#endif
#define AF_IMPLINK 3 ///< ARPAnet IMP address family. #define AF_IMPLINK 3 ///< ARPAnet IMP address family.
#define AF_PUP 4 ///< PUP protocols address family: e.g. BSP #define AF_PUP 4 ///< PUP protocols address family: e.g. BSP
#define AF_CHAOS 5 ///< MIT CHAOS protocols address family #define AF_CHAOS 5 ///< MIT CHAOS protocols address family
@ -69,12 +71,14 @@ typedef uint32_t socklen_t; ///< POSIX compatible type for address length.
#define AF_ISDN 26 ///< Integrated Services Digital Network address family #define AF_ISDN 26 ///< Integrated Services Digital Network address family
#define AF_E164 AF_ISDN ///< CCITT E.164 recommendation #define AF_E164 AF_ISDN ///< CCITT E.164 recommendation
#define pseudo_AF_KEY 27 ///< Internal key-management function (no AF) #define pseudo_AF_KEY 27 ///< Internal key-management function (no AF)
#ifndef AF_INET6
/** /**
* IPv6 address family. * IPv6 address family.
* *
* @see AF_INET * @see AF_INET
*/ */
#define AF_INET6 28 #define AF_INET6 28
#endif
#define AF_NATM 29 ///< native ATM access address family #define AF_NATM 29 ///< native ATM access address family
#define AF_ATM 30 ///< ATM address family #define AF_ATM 30 ///< ATM address family
#define pseudo_AF_HDRCMPLT 31 ///< Used by BPF to not rewrite headers in interface output routine #define pseudo_AF_HDRCMPLT 31 ///< Used by BPF to not rewrite headers in interface output routine

View File

@ -1,5 +1,18 @@
#ifndef INET_NTOP_H_ #ifndef INET_NTOP_H_
#define INET_NTOP_H_ #define INET_NTOP_H_
#include <stdlib.h>
#ifndef AF_INET
#define AF_INET 2 ///< internetwork address family: UDP, TCP, etc.
#endif
#ifndef AF_INET6
/**
* IPv6 address family.
*
* @see AF_INET
*/
#define AF_INET6 28
#endif
#ifndef IN6ADDRSZ #ifndef IN6ADDRSZ
#define IN6ADDRSZ 16 #define IN6ADDRSZ 16

View File

@ -1,5 +1,18 @@
#ifndef INET_PTON_H_ #ifndef INET_PTON_H_
#define INET_PTON_H_ #define INET_PTON_H_
#include <stdlib.h>
#ifndef AF_INET
#define AF_INET 2 ///< internetwork address family: UDP, TCP, etc.
#endif
#ifndef AF_INET6
/**
* IPv6 address family.
*
* @see AF_INET
*/
#define AF_INET6 28
#endif
#ifndef IN6ADDRSZ #ifndef IN6ADDRSZ
#define IN6ADDRSZ 16 #define IN6ADDRSZ 16