Skip to content

Commit

Permalink
Merge pull request #15098 from donaldsharp/lib_zebra_h_cleanup_2
Browse files Browse the repository at this point in the history
Lib zebra h cleanup 2
  • Loading branch information
ton31337 authored Jan 11, 2024
2 parents 5fbf0cc + c402a0b commit 67e8ef2
Show file tree
Hide file tree
Showing 55 changed files with 84 additions and 18 deletions.
2 changes: 2 additions & 0 deletions babeld/babel_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek

/* include zebra library */
#include <zebra.h>
#include <fcntl.h>

#include "getopt.h"
#include "if.h"
#include "log.h"
Expand Down
1 change: 1 addition & 0 deletions babeld/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Copyright 2011, 2012 by Matthieu Boutier and Juliusz Chroboczek
#include <sys/time.h>
#include <sys/param.h>
#include <time.h>
#include <fcntl.h>

#include "babeld.h"

Expand Down
3 changes: 3 additions & 0 deletions bfdd/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#include <zebra.h>

#include <fcntl.h>
#include <sys/stat.h>

#include <sys/un.h>

#include "bfd.h"
Expand Down
1 change: 1 addition & 0 deletions bgpd/bgp_btoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <zebra.h>
#include <fcntl.h>

#include "zebra.h"
#include "stream.h"
Expand Down
1 change: 1 addition & 0 deletions bgpd/bgp_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#include "log.h"
#include "stream.h"
Expand Down
3 changes: 3 additions & 0 deletions isisd/isis_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/

#include <zebra.h>

#include <fcntl.h>

#if ISIS_METHOD == ISIS_METHOD_BPF
#include <net/if.h>
#include <netinet/if_ether.h>
Expand Down
1 change: 1 addition & 0 deletions ldpd/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>
#include <sys/un.h>

#include "ldpd.h"
Expand Down
3 changes: 3 additions & 0 deletions ldpd/ldpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/

#include <zebra.h>

#include <signal.h>
#include <fcntl.h>
#include <sys/wait.h>

#include "ldpd.h"
Expand Down
1 change: 1 addition & 0 deletions ldpd/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#include <zebra.h>
#include <fcntl.h>

#include "ldpd.h"
#include "ldpe.h"
Expand Down
1 change: 1 addition & 0 deletions lib/agentx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <zebra.h>
#include <fcntl.h>

#ifdef SNMP_AGENTX
#include <net-snmp/net-snmp-config.h>
Expand Down
3 changes: 3 additions & 0 deletions lib/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

#include <zebra.h>
#include <sys/utsname.h>
#include <sys/stat.h>
#include <fcntl.h>

#include <lib/version.h>

#include "command.h"
Expand Down
2 changes: 2 additions & 0 deletions lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
/* #define DEBUG */

#include <zebra.h>

#include <signal.h>
#include <sys/resource.h>

#include "frrevent.h"
Expand Down
3 changes: 3 additions & 0 deletions lib/frr_pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*/

#include <zebra.h>

#include <signal.h>

#include <pthread.h>
#ifdef HAVE_PTHREAD_NP_H
#include <pthread_np.h>
Expand Down
4 changes: 4 additions & 0 deletions lib/libfrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
*/

#include <zebra.h>

#include <signal.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <fcntl.h>

#include <sys/types.h>
#include <sys/wait.h>
Expand Down
2 changes: 2 additions & 0 deletions lib/mgmt_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Copyright (c) 2023, LabN Consulting, L.L.C.
*/
#include <zebra.h>
#include <sys/stat.h>

#include "debug.h"
#include "network.h"
#include "sockopt.h"
Expand Down
1 change: 1 addition & 0 deletions lib/netns_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <fcntl.h>

#ifdef HAVE_NETNS
#undef _GNU_SOURCE
Expand Down
1 change: 1 addition & 0 deletions lib/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <fcntl.h>
#include "log.h"
#include "network.h"
#include "lib_errors.h"
Expand Down
1 change: 1 addition & 0 deletions lib/northbound_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#include "libfrr.h"
#include "lib/version.h"
Expand Down
1 change: 1 addition & 0 deletions lib/pid_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <log.h>
#include "lib/version.h"
Expand Down
1 change: 1 addition & 0 deletions lib/privs.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
#include <zebra.h>

#include <pwd.h>
#include <grp.h>

#ifdef HAVE_LCAPS
Expand Down
2 changes: 2 additions & 0 deletions lib/sigevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/

#include <zebra.h>

#include <signal.h>
#include <sigevent.h>
#include <log.h>
#include <memory.h>
Expand Down
1 change: 1 addition & 0 deletions lib/sockunion.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "if.h"
#include <sys/un.h>
#ifdef __OpenBSD__
#include <net/route.h>
#include <netmpls/mpls.h>
#endif

Expand Down
1 change: 1 addition & 0 deletions lib/systemd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>
#include <sys/un.h>

#include "frrevent.h"
Expand Down
1 change: 1 addition & 0 deletions lib/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <zebra.h>
#include <string.h>

#include "vector.h"
#include "memory.h"
Expand Down
2 changes: 2 additions & 0 deletions lib/vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <zebra.h>

#include <fcntl.h>
#include <sys/stat.h>
#include <lib/version.h>
#include <sys/types.h>
#include <sys/types.h>
Expand Down
18 changes: 0 additions & 18 deletions lib/zebra.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@
#include <stdlib.h>
#include <stddef.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <string.h>
#include <pwd.h>
#ifdef HAVE_STROPTS_H
#include <stropts.h>
#endif /* HAVE_STROPTS_H */
#include <sys/select.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/param.h>
#ifdef HAVE_SYS_SYSCTL_H
Expand All @@ -44,9 +37,7 @@
#endif /* HAVE_SYS_KSYM_H */
#include <sys/time.h>
#include <time.h>
#include <limits.h>
#include <inttypes.h>
#include <stdbool.h>
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
Expand Down Expand Up @@ -92,8 +83,6 @@
#include <net/if_var.h>
#endif /* HAVE_NET_IF_VAR_H */

#include <net/route.h>

#ifndef HAVE_NETLINK
#define RT_TABLE_MAIN 0
#define RT_TABLE_LOCAL RT_TABLE_MAIN
Expand Down Expand Up @@ -122,7 +111,6 @@
#include <netinet6/in.h>
#endif /* HAVE_NETINET6_IN_H */


#ifdef HAVE_NETINET6_IP6_H
#include <netinet6/ip6.h>
#endif /* HAVE_NETINET6_IP6_H */
Expand Down Expand Up @@ -236,12 +224,6 @@ struct in_pktinfo {
/* default zebra TCP port for zclient */
#define ZEBRA_PORT 2600

/*
* The compiler.h header is used for anyone using the CPP_NOTICE
* since this is universally needed, let's add it to zebra.h
*/
#include "compiler.h"

/* Zebra route's types are defined in route_types.h */
#include "lib/route_types.h"

Expand Down
2 changes: 2 additions & 0 deletions lib/zlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/

#include "zebra.h"
#include <sys/stat.h>
#include <fcntl.h>

#ifdef HAVE_GLIBC_BACKTRACE
#include <execinfo.h>
Expand Down
1 change: 1 addition & 0 deletions lib/zlog_5424.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include "zebra.h"
#include <fcntl.h>

#include "frrsendmmsg.h"

Expand Down
1 change: 1 addition & 0 deletions lib/zlog_targets.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "zebra.h"

#include <fcntl.h>
#include <sys/un.h>
#include <syslog.h>

Expand Down
1 change: 1 addition & 0 deletions nhrpd/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "zebra.h"

#include <fcntl.h>
#include <errno.h>
#include <linux/if_packet.h>
#include <sys/ioctl.h>
Expand Down
1 change: 1 addition & 0 deletions nhrpd/vici.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <string.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <fcntl.h>

#include "frrevent.h"
#include "zbuf.h"
Expand Down
1 change: 1 addition & 0 deletions ospf6d/ospf6_auth_trailer.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include "zebra.h"
#include <sys/stat.h>

#ifdef CRYPTO_OPENSSL
#include <openssl/evp.h>
Expand Down
1 change: 1 addition & 0 deletions ospfd/ospf_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#ifdef CRYPTO_OPENSSL
#include <openssl/evp.h>
Expand Down
1 change: 1 addition & 0 deletions pimd/pim_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <fcntl.h>

#include <sys/types.h>
#include <sys/socket.h>
Expand Down
1 change: 1 addition & 0 deletions tests/bgpd/test_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include <zebra.h>
#include <fcntl.h>

#include "qobj.h"
#include "vty.h"
Expand Down
1 change: 1 addition & 0 deletions tests/helpers/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#include <lib/version.h>
#include "getopt.h"
Expand Down
1 change: 1 addition & 0 deletions tests/isisd/test_isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#include <lib/version.h>
#include "getopt.h"
Expand Down
1 change: 1 addition & 0 deletions tests/lib/cli/common_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#include "frrevent.h"
#include "vty.h"
Expand Down
1 change: 1 addition & 0 deletions tests/lib/northbound/test_oper_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#include "frrevent.h"
#include "vty.h"
Expand Down
1 change: 1 addition & 0 deletions tests/lib/test_privs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

#include <zebra.h>
#include <sys/stat.h>

#include <lib/version.h>
#include "getopt.h"
Expand Down
1 change: 1 addition & 0 deletions tests/ospfd/test_ospf_spf.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <zebra.h>
#include <sys/stat.h>

#include "getopt.h"
#include "frrevent.h"
Expand Down
Loading

0 comments on commit 67e8ef2

Please sign in to comment.