summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-01-29 20:59:01 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 02:27:08 +0200
commit63d4bd12ca9a7fc666dcd112c940f4ac693b32ae (patch)
tree7ea0c8ee29499c0e26a235b74b8fbfbf86ebf77a
parentvrrpd: improve show vrrp (diff)
downloadfrr-63d4bd12ca9a7fc666dcd112c940f4ac693b32ae.tar.xz
frr-63d4bd12ca9a7fc666dcd112c940f4ac693b32ae.zip
vrrpd: fix headers
* Add include guards where missing * Add include guard comments where missing * Fix copyright notices * Sort includes Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--vrrpd/vrrp.c6
-rw-r--r--vrrpd/vrrp.h12
-rw-r--r--vrrpd/vrrp_arp.c10
-rw-r--r--vrrpd/vrrp_arp.h18
-rw-r--r--vrrpd/vrrp_main.c33
-rw-r--r--vrrpd/vrrp_memory.c7
-rw-r--r--vrrpd/vrrp_memory.h10
-rw-r--r--vrrpd/vrrp_ndisc.c3
-rw-r--r--vrrpd/vrrp_ndisc.h8
-rw-r--r--vrrpd/vrrp_packet.c6
-rw-r--r--vrrpd/vrrp_packet.h17
-rw-r--r--vrrpd/vrrp_vty.c6
-rw-r--r--vrrpd/vrrp_vty.h10
-rw-r--r--vrrpd/vrrp_zebra.c10
-rw-r--r--vrrpd/vrrp_zebra.h9
15 files changed, 87 insertions, 78 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 0c0ef9709..08517c79d 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -1,7 +1,7 @@
/*
- * VRRPD global definitions and state machine
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP global definitions and state machine.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
diff --git a/vrrpd/vrrp.h b/vrrpd/vrrp.h
index 0249b3e9a..d060b95df 100644
--- a/vrrpd/vrrp.h
+++ b/vrrpd/vrrp.h
@@ -1,7 +1,7 @@
/*
- * VRRPD global definitions and state machine
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP global definitions and state machine.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -17,8 +17,8 @@
* 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 _VRRP_H
-#define _VRRP_H
+#ifndef __VRRP_H__
+#define __VRRP_H__
#include <zebra.h>
#include <netinet/ip.h>
@@ -335,4 +335,4 @@ int vrrp_event(struct vrrp_router *r, int event);
*/
struct vrrp_vrouter *vrrp_lookup(uint8_t vrid);
-#endif /* _VRRP_H */
+#endif /* __VRRP_H__ */
diff --git a/vrrpd/vrrp_arp.c b/vrrpd/vrrp_arp.c
index e7a037d08..7e77d7df1 100644
--- a/vrrpd/vrrp_arp.c
+++ b/vrrpd/vrrp_arp.c
@@ -1,10 +1,9 @@
/*
- * VRRP ARP primitives.
- *
+ * VRRP ARP handling.
* Copyright (C) 2001-2017 Alexandre Cassen
* Portions:
- * Copyright (C) 2018 Cumulus Networks
- * Quentin Young
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -20,11 +19,10 @@
* 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
*/
-
#include <zebra.h>
-#include <net/if_arp.h>
#include <linux/if_packet.h>
+#include <net/if_arp.h>
#include <netinet/if_ether.h>
#include "lib/if.h"
diff --git a/vrrpd/vrrp_arp.h b/vrrpd/vrrp_arp.h
index 1de94a151..21f2c4edd 100644
--- a/vrrpd/vrrp_arp.h
+++ b/vrrpd/vrrp_arp.h
@@ -1,7 +1,7 @@
/*
- * VRRPD global definitions
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP ARP handling.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -13,12 +13,12 @@
* 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
+ * 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 _VRRP_ARP_H
-#define _VRRP_ARP_H
+#ifndef __VRRP_ARP_H__
+#define __VRRP_ARP_H__
#include <zebra.h>
@@ -27,10 +27,10 @@
/* FIXME: Use the kernel define for this */
#define HWTYPE_ETHER 1
-/* prototypes */
extern void vrrp_garp_init(void);
extern void vrrp_garp_fini(void);
extern bool vrrp_garp_is_init(void);
extern void vrrp_garp_send(struct vrrp_router *vr, struct in_addr *v4);
extern void vrrp_garp_send_all(struct vrrp_router *vr);
-#endif
+
+#endif /* __VRRP_ARP_H__ */
diff --git a/vrrpd/vrrp_main.c b/vrrpd/vrrp_main.c
index d60f37d8f..daaadffab 100644
--- a/vrrpd/vrrp_main.c
+++ b/vrrpd/vrrp_main.c
@@ -1,7 +1,7 @@
/*
- * VRRP
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP entry point.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -20,22 +20,23 @@
#include <zebra.h>
#include <lib/version.h>
-#include "getopt.h"
-#include "thread.h"
-#include "command.h"
-#include "log.h"
-#include "memory.h"
-#include "privs.h"
-#include "sigevent.h"
-#include "libfrr.h"
-#include "vrf.h"
-#include "nexthop.h"
-#include "filter.h"
-#include "if.h"
+
+#include "lib/command.h"
+#include "lib/filter.h"
+#include "lib/getopt.h"
+#include "lib/if.h"
+#include "lib/libfrr.h"
+#include "lib/log.h"
+#include "lib/memory.h"
+#include "lib/nexthop.h"
+#include "lib/privs.h"
+#include "lib/sigevent.h"
+#include "lib/thread.h"
+#include "lib/vrf.h"
#include "vrrp.h"
-#include "vrrp_zebra.h"
#include "vrrp_vty.h"
+#include "vrrp_zebra.h"
char backup_config_file[256];
diff --git a/vrrpd/vrrp_memory.c b/vrrpd/vrrp_memory.c
index 4a7c0b7e4..9ce7c9041 100644
--- a/vrrpd/vrrp_memory.c
+++ b/vrrpd/vrrp_memory.c
@@ -1,7 +1,7 @@
/*
- * VRRPD memory types
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP memory types.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -19,6 +19,7 @@
*/
#include <zebra.h>
#include <memory.h>
+
#include "vrrp_memory.h"
DEFINE_MGROUP(VRRP, "vrrpd")
diff --git a/vrrpd/vrrp_memory.h b/vrrpd/vrrp_memory.h
index f57a86480..ae6975478 100644
--- a/vrrpd/vrrp_memory.h
+++ b/vrrpd/vrrp_memory.h
@@ -1,7 +1,7 @@
/*
- * VRRPD memory types
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP memory types.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -20,8 +20,8 @@
#ifndef __VRRP_MEMORY_H__
#define __VRRP_MEMORY_H__
-#include "memory.h"
+#include "lib/memory.h"
DECLARE_MGROUP(VRRP)
-#endif
+#endif /* __VRRP_MEMORY_H__ */
diff --git a/vrrpd/vrrp_ndisc.c b/vrrpd/vrrp_ndisc.c
index ce6c62c07..73ee172aa 100644
--- a/vrrpd/vrrp_ndisc.c
+++ b/vrrpd/vrrp_ndisc.c
@@ -1,7 +1,8 @@
/*
* VRRP Neighbor Discovery.
* Copyright (C) 2019 Cumulus Networks, Inc.
- * Quentin Young
+ * Quentin Young
+ *
* Portions:
* Copyright (C) 2001-2017 Alexandre Cassen
*
diff --git a/vrrpd/vrrp_ndisc.h b/vrrpd/vrrp_ndisc.h
index 262d3db03..efbef348d 100644
--- a/vrrpd/vrrp_ndisc.h
+++ b/vrrpd/vrrp_ndisc.h
@@ -1,7 +1,7 @@
/*
* VRRP Neighbor Discovery.
* Copyright (C) 2019 Cumulus Networks, Inc.
- * Quentin Young
+ * Quentin Young
*
* 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
@@ -17,8 +17,8 @@
* 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 _VRRP_NDISC_H
-#define _VRRP_NDISC_H
+#ifndef __VRRP_NDISC_H__
+#define __VRRP_NDISC_H__
#include <netinet/icmp6.h>
#include <netinet/in.h>
@@ -71,4 +71,4 @@ extern int vrrp_ndisc_una_send(struct vrrp_router *r, struct ipaddr *ip);
*/
extern int vrrp_ndisc_una_send_all(struct vrrp_router *r);
-#endif
+#endif /* __VRRP_NDISC_H__ */
diff --git a/vrrpd/vrrp_packet.c b/vrrpd/vrrp_packet.c
index bf1197422..fd0256d6e 100644
--- a/vrrpd/vrrp_packet.c
+++ b/vrrpd/vrrp_packet.c
@@ -1,7 +1,7 @@
/*
- * VRRPD packet crafting
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP packet crafting.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
diff --git a/vrrpd/vrrp_packet.h b/vrrpd/vrrp_packet.h
index 3a5b161fb..df43ee760 100644
--- a/vrrpd/vrrp_packet.h
+++ b/vrrpd/vrrp_packet.h
@@ -1,7 +1,7 @@
/*
- * VRRPD packet crafting
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP packet crafting.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -17,11 +17,14 @@
* 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 __VRRP_PACKET_H__
+#define __VRRP_PACKET_H__
+
#include <zebra.h>
-#include "memory.h"
-#include "ipaddr.h"
-#include "prefix.h"
+#include "lib/ipaddr.h"
+#include "lib/memory.h"
+#include "lib/prefix.h"
#define VRRP_VERSION 3
#define VRRP_TYPE_ADVERTISEMENT 1
@@ -170,3 +173,5 @@ size_t vrrp_pkt_dump(char *buf, size_t buflen, struct vrrp_pkt *pkt);
ssize_t vrrp_parse_datagram(int family, struct msghdr *m, size_t read,
struct vrrp_pkt **pkt, char *errmsg,
size_t errmsg_len);
+
+#endif /* __VRRP_PACKET_H__ */
diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c
index 553e3947b..ff8f1e68e 100644
--- a/vrrpd/vrrp_vty.c
+++ b/vrrpd/vrrp_vty.c
@@ -1,7 +1,7 @@
/*
- * VRRP commands
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP CLI commands.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
diff --git a/vrrpd/vrrp_vty.h b/vrrpd/vrrp_vty.h
index 2aa47ec20..377321ec4 100644
--- a/vrrpd/vrrp_vty.h
+++ b/vrrpd/vrrp_vty.h
@@ -1,7 +1,8 @@
/*
- * VRRP commands
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP CLI commands.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
+ *
* 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)
@@ -20,4 +21,5 @@
#define __VRRP_VTY_H__
void vrrp_vty_init(void);
-#endif
+
+#endif /* __VRRP_VTY_H__ */
diff --git a/vrrpd/vrrp_zebra.c b/vrrpd/vrrp_zebra.c
index 1c4b0a382..1bd5aa013 100644
--- a/vrrpd/vrrp_zebra.c
+++ b/vrrpd/vrrp_zebra.c
@@ -1,7 +1,7 @@
/*
- * Zebra interfacing
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP Zebra interfacing.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -20,11 +20,11 @@
#include <zebra.h>
#include "lib/if.h"
+#include "lib/linklist.h"
#include "lib/log.h"
#include "lib/prefix.h"
-#include "lib/zclient.h"
#include "lib/vty.h"
-#include "lib/linklist.h"
+#include "lib/zclient.h"
#include "vrrp.h"
#include "vrrp_zebra.h"
diff --git a/vrrpd/vrrp_zebra.h b/vrrpd/vrrp_zebra.h
index 70871cd89..5e8ff0954 100644
--- a/vrrpd/vrrp_zebra.h
+++ b/vrrpd/vrrp_zebra.h
@@ -1,7 +1,7 @@
/*
- * Zebra interfacing
- * Copyright (C) 2018 Cumulus Networks, Inc.
- * Quentin Young
+ * VRRP Zebra interfacing.
+ * Copyright (C) 2018-2019 Cumulus Networks, Inc.
+ * Quentin Young
*
* 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
@@ -22,4 +22,5 @@
extern void vrrp_zebra_init(void);
extern void vrrp_zebra_radv_set(struct vrrp_router *r, bool enable);
-#endif
+
+#endif /* __VRRP_ZEBRA_H__ */