if2ip.h
Go to the documentation of this file.
00001 #ifndef HEADER_CURL_IF2IP_H
00002 #define HEADER_CURL_IF2IP_H
00003 /***************************************************************************
00004  *                                  _   _ ____  _
00005  *  Project                     ___| | | |  _ \| |
00006  *                             / __| | | | |_) | |
00007  *                            | (__| |_| |  _ <| |___
00008  *                             \___|\___/|_| \_\_____|
00009  *
00010  * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
00011  *
00012  * This software is licensed as described in the file COPYING, which
00013  * you should have received as part of this distribution. The terms
00014  * are also available at https://curl.haxx.se/docs/copyright.html.
00015  *
00016  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
00017  * copies of the Software, and permit persons to whom the Software is
00018  * furnished to do so, under the terms of the COPYING file.
00019  *
00020  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
00021  * KIND, either express or implied.
00022  *
00023  ***************************************************************************/
00024 #include "curl_setup.h"
00025 
00026 /* IPv6 address scopes. */
00027 #define IPV6_SCOPE_GLOBAL       0       /* Global scope. */
00028 #define IPV6_SCOPE_LINKLOCAL    1       /* Link-local scope. */
00029 #define IPV6_SCOPE_SITELOCAL    2       /* Site-local scope (deprecated). */
00030 #define IPV6_SCOPE_NODELOCAL    3       /* Loopback. */
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, /* Interface not found */
00038   IF2IP_AF_NOT_SUPPORTED = 1, /* Int. exists but has no address for this af */
00039   IF2IP_FOUND = 2 /* The address has been stored in "buf" */
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 /* Nedelcho Stanev's work-around for SFU 3.0 */
00049 struct ifreq {
00050 #define IFNAMSIZ 16
00051 #define IFHWADDRLEN 6
00052   union {
00053     char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
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 /* This define was added by Daniel to avoid an extra #ifdef INTERIX in the
00068    C code. */
00069 
00070 #define ifr_name ifr_ifrn.ifrn_name /* interface name */
00071 #define ifr_addr ifr_ifru.ifru_addr /* address */
00072 #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
00073 #define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
00074 #define ifr_flags ifr_ifru.ifru_flags /* flags */
00075 #define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
00076 #define ifr_metric ifr_ifru.ifru_metric /* metric */
00077 #define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
00078 
00079 #define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */
00080 
00081 #endif /* __INTERIX */
00082 
00083 #endif /* HEADER_CURL_IF2IP_H */


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:04