]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_msg.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / pimd / pim_msg.h
index 456c356d9faf377e58b1982fe05f7817f3cb70f3..56923b7ec18ff2d55e3902fba947f1040fe03eef 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * PIM for Quagga
  * Copyright (C) 2008  Everton da Silva Marques
- *
- * 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_MSG_H
@@ -161,10 +148,18 @@ struct pim_encoded_source_ipv6 {
 typedef struct pim_encoded_ipv4_unicast pim_encoded_unicast;
 typedef struct pim_encoded_group_ipv4   pim_encoded_group;
 typedef struct pim_encoded_source_ipv4  pim_encoded_source;
+typedef struct ip                      ipv_hdr;
+#define IPV_SRC(ip_hdr)                        ((ip_hdr))->ip_src
+#define IPV_DST(ip_hdr)                        ((ip_hdr))->ip_dst
+#define IPV_LEN(ip_hdr)                        ((ip_hdr))->ip_len
 #else
 typedef struct pim_encoded_ipv6_unicast pim_encoded_unicast;
 typedef struct pim_encoded_group_ipv6   pim_encoded_group;
 typedef struct pim_encoded_source_ipv6  pim_encoded_source;
+typedef struct ip6_hdr                         ipv_hdr;
+#define IPV_SRC(ip_hdr)                        ((ip_hdr))->ip6_src
+#define IPV_DST(ip_hdr)                        ((ip_hdr))->ip6_dst
+#define IPV_LEN(ip_hdr)                        ((ip_hdr))->ip6_plen
 #endif
 /* clang-format on */
 
@@ -208,8 +203,9 @@ static inline pim_sgaddr pim_sgaddr_from_iphdr(const void *iphdr)
 }
 #endif
 
-void pim_msg_build_header(uint8_t *pim_msg, size_t pim_msg_size,
-                         uint8_t pim_msg_type, bool no_fwd);
+void pim_msg_build_header(pim_addr src, pim_addr dst, uint8_t *pim_msg,
+                         size_t pim_msg_size, uint8_t pim_msg_type,
+                         bool no_fwd);
 uint8_t *pim_msg_addr_encode_ipv4_ucast(uint8_t *buf, struct in_addr addr);
 uint8_t *pim_msg_addr_encode_ipv4_group(uint8_t *buf, struct in_addr addr);