Reorder top section of net_util.h to batch includes together

This commit is contained in:
Tim Wojtulewicz 2025-04-07 16:45:04 -07:00
parent 648f0f0623
commit 661b230f23

View file

@ -5,18 +5,9 @@
#include "zeek/zeek-config.h" #include "zeek/zeek-config.h"
#include <cstdint> #include <cstdint>
#include <memory>
// Define first. #include <string>
enum TransportProto : uint8_t { #include <utility>
TRANSPORT_UNKNOWN,
TRANSPORT_TCP,
TRANSPORT_UDP,
TRANSPORT_ICMP,
};
extern const char* transport_proto_string(TransportProto proto);
enum IPFamily { IPv4, IPv6 };
// Force these files to stay in this order. Normally, clang-format // Force these files to stay in this order. Normally, clang-format
// wants to move sys/types.h to the end of this block, but that // wants to move sys/types.h to the end of this block, but that
@ -36,8 +27,6 @@ enum IPFamily { IPv4, IPv6 };
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <netinet/udp.h> #include <netinet/udp.h>
#include "zeek/util.h"
#ifdef HAVE_NETINET_IP6_H #ifdef HAVE_NETINET_IP6_H
#include <netinet/ip6.h> #include <netinet/ip6.h>
@ -126,6 +115,18 @@ struct ip6_rthdr {
#define TCPOPT_TIMESTAMP TCPOPT_TSTAMP #define TCPOPT_TIMESTAMP TCPOPT_TSTAMP
#endif #endif
// Define first.
enum TransportProto : uint8_t {
TRANSPORT_UNKNOWN,
TRANSPORT_TCP,
TRANSPORT_UDP,
TRANSPORT_ICMP,
};
extern const char* transport_proto_string(TransportProto proto);
enum IPFamily { IPv4, IPv6 };
namespace zeek { namespace zeek {
class IPAddr; class IPAddr;