2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2015-02-04 07:01:14 +01:00
|
|
|
/*
|
2017-05-13 10:25:29 +02:00
|
|
|
* PIM for Quagga
|
|
|
|
* Copyright (C) 2008 Everton da Silva Marques
|
|
|
|
*/
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
#ifndef PIM_SOCK_H
|
|
|
|
#define PIM_SOCK_H
|
|
|
|
|
|
|
|
#include <netinet/in.h>
|
|
|
|
|
|
|
|
#define PIM_SOCK_ERR_NONE (0) /* No error */
|
|
|
|
#define PIM_SOCK_ERR_SOCKET (-1) /* socket() */
|
|
|
|
#define PIM_SOCK_ERR_RA (-2) /* Router Alert option */
|
|
|
|
#define PIM_SOCK_ERR_REUSE (-3) /* Reuse option */
|
|
|
|
#define PIM_SOCK_ERR_TTL (-4) /* TTL option */
|
|
|
|
#define PIM_SOCK_ERR_LOOP (-5) /* Loopback option */
|
|
|
|
#define PIM_SOCK_ERR_IFACE (-6) /* Outgoing interface option */
|
|
|
|
#define PIM_SOCK_ERR_DSTADDR (-7) /* Outgoing interface option */
|
|
|
|
#define PIM_SOCK_ERR_NONBLOCK_GETFL (-8) /* Get O_NONBLOCK */
|
|
|
|
#define PIM_SOCK_ERR_NONBLOCK_SETFL (-9) /* Set O_NONBLOCK */
|
|
|
|
#define PIM_SOCK_ERR_NAME (-10) /* Socket name (getsockname) */
|
2016-06-29 03:50:49 +02:00
|
|
|
#define PIM_SOCK_ERR_BIND (-11) /* Can't bind to interface */
|
2015-02-04 07:01:14 +01:00
|
|
|
|
2022-05-06 12:36:51 +02:00
|
|
|
struct pim_instance;
|
|
|
|
|
2016-07-28 02:13:16 +02:00
|
|
|
int pim_socket_bind(int fd, struct interface *ifp);
|
2017-08-25 01:54:21 +02:00
|
|
|
void pim_socket_ip_hdr(int fd);
|
2024-07-26 16:57:44 +02:00
|
|
|
int pim_setsockopt_packetinfo(int fd);
|
2015-02-04 07:01:14 +01:00
|
|
|
int pim_socket_raw(int protocol);
|
2022-03-03 07:54:19 +01:00
|
|
|
int pim_socket_mcast(int protocol, pim_addr ifaddr, struct interface *ifp,
|
2018-03-27 21:13:34 +02:00
|
|
|
uint8_t loop);
|
pimd: Add IGMP join sent/failed statistics
```
exit1-debian-11# sh ip igmp statistics
IGMP statistics
Interface : global
V1 query : 0
V2 query : 0
V3 query : 0
V2 leave : 0
V1 report : 0
V2 report : 0
V3 report : 16
mtrace response : 0
mtrace request : 0
unsupported : 0
joins failed : 0
joins sent : 11
total groups : 4
total source groups : 0
exit1-debian-11# sh ip igmp statistics json
{
"global":{
"name":"global",
"queryV1":0,
"queryV2":0,
"queryV3":0,
"leaveV3":0,
"reportV1":0,
"reportV2":0,
"reportV3":16,
"mtraceResponse":0,
"mtraceRequest":0,
"unsupported":0,
"totalGroups":4,
"totalSourceGroups":0,
"joinsFailed":0,
"joinsSent":11
}
}
```
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-10 17:10:43 +01:00
|
|
|
int pim_socket_join(int fd, pim_addr group, pim_addr ifaddr, ifindex_t ifindex,
|
|
|
|
struct pim_interface *pim_ifp);
|
2024-09-17 04:32:59 +02:00
|
|
|
int pim_socket_leave(int fd, pim_addr group, pim_addr ifaddr, ifindex_t ifindex,
|
|
|
|
struct pim_interface *pim_ifp);
|
2015-02-04 07:01:14 +01:00
|
|
|
int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
|
2022-03-03 07:54:19 +01:00
|
|
|
struct sockaddr_storage *from, socklen_t *fromlen,
|
|
|
|
struct sockaddr_storage *to, socklen_t *tolen,
|
2016-01-18 11:12:10 +01:00
|
|
|
ifindex_t *ifindex);
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
int pim_socket_getsockname(int fd, struct sockaddr *name, socklen_t *namelen);
|
|
|
|
|
2022-08-02 08:12:53 +02:00
|
|
|
int pim_reg_sock(void);
|
|
|
|
|
2015-02-04 07:01:14 +01:00
|
|
|
#endif /* PIM_SOCK_H */
|