+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Multicast traceroute for FRRouting
* Copyright (C) 2017 Mladen Sablic
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PIM_IGMP_MTRACE_H
#define MTRACE_MAX_HOPS (255)
#define MTRACE_UNKNOWN_COUNT (0xffffffff)
+#define MTRACE_SRC_MASK_GROUP (0x3f) /* forwarding on group state (*,G) */
+#define MTRACE_SRC_MASK_SOURCE (0x20) /* i.e. 32 forwarding on (S,G) */
enum mtrace_fwd_code {
- MTRACE_FWD_CODE_NO_ERROR = 0x00,
- MTRACE_FWD_CODE_WRONG_IF = 0x01,
- MTRACE_FWD_CODE_PRUNE_SENT = 0x02,
- MTRACE_FWD_CODE_PRUNE_RCVD = 0x03,
- MTRACE_FWD_CODE_SCOPED = 0x04,
- MTRACE_FWD_CODE_NO_ROUTE = 0x05,
- MTRACE_FWD_CODE_WRONG_LAST_HOP = 0x06,
- MTRACE_FWD_CODE_NOT_FORWARDING = 0x07,
- MTRACE_FWD_CODE_REACHED_RP = 0x08,
- MTRACE_FWD_CODE_RPF_IF = 0x09,
- MTRACE_FWD_CODE_NO_MULTICAST = 0x0A,
- MTRACE_FWD_CODE_INFO_HIDDEN = 0x0B,
- MTRACE_FWD_CODE_NO_SPACE = 0x81,
- MTRACE_FWD_CODE_OLD_ROUTER = 0x82,
- MTRACE_FWD_CODE_ADMIN_PROHIB = 0x83
+ MTRACE_FWD_CODE_NO_ERROR = 0x00,
+ MTRACE_FWD_CODE_WRONG_IF = 0x01,
+ MTRACE_FWD_CODE_PRUNE_SENT = 0x02,
+ MTRACE_FWD_CODE_PRUNE_RCVD = 0x03,
+ MTRACE_FWD_CODE_SCOPED = 0x04,
+ MTRACE_FWD_CODE_NO_ROUTE = 0x05,
+ MTRACE_FWD_CODE_WRONG_LAST_HOP = 0x06,
+ MTRACE_FWD_CODE_NOT_FORWARDING = 0x07,
+ MTRACE_FWD_CODE_REACHED_RP = 0x08,
+ MTRACE_FWD_CODE_RPF_IF = 0x09,
+ MTRACE_FWD_CODE_NO_MULTICAST = 0x0A,
+ MTRACE_FWD_CODE_INFO_HIDDEN = 0x0B,
+ MTRACE_FWD_CODE_NO_SPACE = 0x81,
+ MTRACE_FWD_CODE_OLD_ROUTER = 0x82,
+ MTRACE_FWD_CODE_ADMIN_PROHIB = 0x83
};
enum mtrace_rtg_proto {
- MTRACE_RTG_PROTO_DVMRP = 1,
- MTRACE_RTG_PROTO_MOSPF = 2,
- MTRACE_RTG_PROTO_PIM = 3,
- MTRACE_RTG_PROTO_CBT = 4,
- MTRACE_RTG_PROTO_PIM_SPECIAL = 5,
- MTRACE_RTG_PROTO_PIM_STATIC = 6,
- MTRACE_RTG_PROTO_DVMRP_STATIC = 7,
- MTRACE_RTG_PROTO_PIM_MBGP = 8,
- MTRACE_RTG_PROTO_CBT_SPECIAL = 9,
- MTRACE_RTG_PROTO_CBT_STATIC = 10,
- MTRACE_RTG_PROTO_PIM_ASSERT = 11,
+ MTRACE_RTG_PROTO_DVMRP = 1,
+ MTRACE_RTG_PROTO_MOSPF = 2,
+ MTRACE_RTG_PROTO_PIM = 3,
+ MTRACE_RTG_PROTO_CBT = 4,
+ MTRACE_RTG_PROTO_PIM_SPECIAL = 5,
+ MTRACE_RTG_PROTO_PIM_STATIC = 6,
+ MTRACE_RTG_PROTO_DVMRP_STATIC = 7,
+ MTRACE_RTG_PROTO_PIM_MBGP = 8,
+ MTRACE_RTG_PROTO_CBT_SPECIAL = 9,
+ MTRACE_RTG_PROTO_CBT_STATIC = 10,
+ MTRACE_RTG_PROTO_PIM_ASSERT = 11,
};
struct igmp_mtrace_rsp {
#define MTRACE_HDR_SIZE (sizeof(struct igmp_mtrace))
#define MTRACE_RSP_SIZE (sizeof(struct igmp_mtrace_rsp))
-int igmp_mtrace_recv_qry_req(struct igmp_sock *igmp, struct ip *ip_hdr,
+int igmp_mtrace_recv_qry_req(struct gm_sock *igmp, struct ip *ip_hdr,
struct in_addr from, const char *from_str,
char *igmp_msg, int igmp_msg_len);
-int igmp_mtrace_recv_response(struct igmp_sock *igmp, struct ip *ip_hdr,
+int igmp_mtrace_recv_response(struct gm_sock *igmp, struct ip *ip_hdr,
struct in_addr from, const char *from_str,
char *igmp_msg, int igmp_msg_len);