3 * The olsr.org Optimized Link-State Routing daemon(olsrd)
4 * Copyright (c) 2004, Andreas Tonnesen(andreto@olsr.org)
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of olsr.org, olsrd nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
34 * Visit http://www.olsr.org for more information.
36 * If you find this software useful feel free to make a donation
37 * to the project. For more information see the website or contact
38 * the copyright holders.
43 * This file defines the OS dependent network related functions
44 * that MUST be available to olsrd.
45 * The implementations of the functions should be found in
46 * <OS>/net.c (e.g. linux/net.c)
49 #ifndef _OLSR_NET_OS_H
50 #define _OLSR_NET_OS_H
52 #include "olsr_types.h"
53 #include "interfaces.h"
55 /* OS dependent functions */
56 ssize_t olsr_sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t);
58 ssize_t olsr_recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *);
60 int olsr_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
62 int bind_socket_to_device(int, char *);
64 int convert_ip_to_mac(union olsr_ip_addr *, struct sockaddr *, char *);
66 void net_os_set_global_ifoptions(void);
67 int net_os_set_ifoptions(const char *if_name, struct interface_olsr *iface);
68 int net_os_restore_ifoptions(void);
70 int gethemusocket(struct sockaddr_in *pin);
72 int getsocket(int, struct interface_olsr *);
74 int getsocket6(int, struct interface_olsr *);
76 int get_ipv6_address(char *, struct sockaddr_in6 *, struct olsr_ip_prefix *);
78 int calculate_if_metric(char *);
80 int check_wireless_interface(char *);
82 bool is_if_link_up(char *);
84 int join_mcast(struct interface_olsr *, int);
86 bool olsr_if_isup(const char * dev);
87 int olsr_if_set_state(const char *dev, bool up);
88 #endif /* _OLSR_NET_OS_H */
93 * indent-tabs-mode: nil