Go to the documentation of this file.00001 #ifndef HEADER_CURL_IF2IP_H
00002 #define HEADER_CURL_IF2IP_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "curl_setup.h"
00025
00026
00027 #define IPV6_SCOPE_GLOBAL 0
00028 #define IPV6_SCOPE_LINKLOCAL 1
00029 #define IPV6_SCOPE_SITELOCAL 2
00030 #define IPV6_SCOPE_NODELOCAL 3
00031
00032 unsigned int Curl_ipv6_scope(const struct sockaddr *sa);
00033
00034 bool Curl_if_is_interface_name(const char *interf);
00035
00036 typedef enum {
00037 IF2IP_NOT_FOUND = 0,
00038 IF2IP_AF_NOT_SUPPORTED = 1,
00039 IF2IP_FOUND = 2
00040 } if2ip_result_t;
00041
00042 if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope,
00043 unsigned int remote_scope_id, const char *interf,
00044 char *buf, int buf_size);
00045
00046 #ifdef __INTERIX
00047
00048
00049 struct ifreq {
00050 #define IFNAMSIZ 16
00051 #define IFHWADDRLEN 6
00052 union {
00053 char ifrn_name[IFNAMSIZ];
00054 } ifr_ifrn;
00055
00056 union {
00057 struct sockaddr ifru_addr;
00058 struct sockaddr ifru_broadaddr;
00059 struct sockaddr ifru_netmask;
00060 struct sockaddr ifru_hwaddr;
00061 short ifru_flags;
00062 int ifru_metric;
00063 int ifru_mtu;
00064 } ifr_ifru;
00065 };
00066
00067
00068
00069
00070 #define ifr_name ifr_ifrn.ifrn_name
00071 #define ifr_addr ifr_ifru.ifru_addr
00072 #define ifr_broadaddr ifr_ifru.ifru_broadaddr
00073 #define ifr_netmask ifr_ifru.ifru_netmask
00074 #define ifr_flags ifr_ifru.ifru_flags
00075 #define ifr_hwaddr ifr_ifru.ifru_hwaddr
00076 #define ifr_metric ifr_ifru.ifru_metric
00077 #define ifr_mtu ifr_ifru.ifru_mtu
00078
00079 #define SIOCGIFADDR _IOW('s', 102, struct ifreq)
00080
00081 #endif
00082
00083 #endif