]>
Commit | Line | Data |
---|---|---|
12e41d03 DL |
1 | /* |
2 | PIM for Quagga | |
3 | Copyright (C) 2008 Everton da Silva Marques | |
4 | ||
5 | This program is free software; you can redistribute it and/or modify | |
6 | it under the terms of the GNU General Public License as published by | |
7 | the Free Software Foundation; either version 2 of the License, or | |
8 | (at your option) any later version. | |
9 | ||
10 | This program is distributed in the hope that it will be useful, but | |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
16 | along with this program; see the file COPYING; if not, write to the | |
17 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, | |
18 | MA 02110-1301 USA | |
12e41d03 DL |
19 | */ |
20 | ||
21 | #ifndef PIM_SOCK_H | |
22 | #define PIM_SOCK_H | |
23 | ||
24 | #include <netinet/in.h> | |
25 | ||
26 | #define PIM_SOCK_ERR_NONE (0) /* No error */ | |
27 | #define PIM_SOCK_ERR_SOCKET (-1) /* socket() */ | |
28 | #define PIM_SOCK_ERR_RA (-2) /* Router Alert option */ | |
29 | #define PIM_SOCK_ERR_REUSE (-3) /* Reuse option */ | |
30 | #define PIM_SOCK_ERR_TTL (-4) /* TTL option */ | |
31 | #define PIM_SOCK_ERR_LOOP (-5) /* Loopback option */ | |
32 | #define PIM_SOCK_ERR_IFACE (-6) /* Outgoing interface option */ | |
33 | #define PIM_SOCK_ERR_DSTADDR (-7) /* Outgoing interface option */ | |
34 | #define PIM_SOCK_ERR_NONBLOCK_GETFL (-8) /* Get O_NONBLOCK */ | |
35 | #define PIM_SOCK_ERR_NONBLOCK_SETFL (-9) /* Set O_NONBLOCK */ | |
36 | #define PIM_SOCK_ERR_NAME (-10) /* Socket name (getsockname) */ | |
61ea3951 | 37 | #define PIM_SOCK_ERR_BIND (-11) /* Can't bind to interface */ |
12e41d03 | 38 | |
728cd663 | 39 | int pim_socket_bind (int fd, struct interface *ifp); |
31c680fc | 40 | int pim_socket_ip_hdr (int fd); |
12e41d03 | 41 | int pim_socket_raw(int protocol); |
b35702d0 | 42 | int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp, u_char loop); |
12e41d03 | 43 | int pim_socket_join(int fd, struct in_addr group, |
b892f1dd PJ |
44 | struct in_addr ifaddr, ifindex_t ifindex); |
45 | int pim_socket_join_source(int fd, ifindex_t ifindex, | |
12e41d03 DL |
46 | struct in_addr group_addr, |
47 | struct in_addr source_addr, | |
48 | const char *ifname); | |
49 | int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len, | |
50 | struct sockaddr_in *from, socklen_t *fromlen, | |
51 | struct sockaddr_in *to, socklen_t *tolen, | |
b892f1dd | 52 | ifindex_t *ifindex); |
12e41d03 DL |
53 | |
54 | int pim_socket_mcastloop_get(int fd); | |
55 | ||
56 | int pim_socket_getsockname(int fd, struct sockaddr *name, socklen_t *namelen); | |
57 | ||
58 | #endif /* PIM_SOCK_H */ |