Minor fixes for build problems after reformatting

This commit is contained in:
Tim Wojtulewicz 2021-09-16 15:35:59 -07:00
parent b2f171ec69
commit 30aa4621c5
12 changed files with 231 additions and 214 deletions

8
NEWS
View file

@ -9,6 +9,14 @@ Zeek 4.2.0
New Functionality
-----------------
- Zeek now supports formatting the C++ code using clang-format. It requires at
least clang-format 12.0.1 due to some additions that were made in that version
to better support the Whitesmiths style. Zeek also includes a set of python
scripts to more easily reformat in the auxil/run-clang-format directory. An
example command to reformat the code:
`python3 auxil/run-clang-format/run-clang-format.py --clang-format-executable `which clang-format-12` -r src -i`
Changed Functionality
---------------------

View file

@ -1,10 +1,3 @@
#include "zeek/EventLauncher.h"
#include "zeek/Conn.h"
#include "zeek/Event.h"
#include "zeek/File.h"
#include "zeek/NetVar.h"
#include "zeek/Val.h"
#include "zeek/analyzer/Analyzer.h"
#include "event.bif.func_def"

View file

@ -1,3 +1,10 @@
#pragma once
#include "zeek/Conn.h"
#include "zeek/Event.h"
#include "zeek/File.h"
#include "zeek/NetVar.h"
#include "zeek/Val.h"
#include "zeek/analyzer/Analyzer.h"
#include "event.bif.func_h"

View file

@ -2,9 +2,9 @@
#pragma once
#include <sys/types.h> // for u_char
#include <netinet/in.h>
#include <netinet/ip.h>
#include <sys/types.h> // for u_char
#include "zeek/zeek-config.h"

View file

@ -212,10 +212,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
// Count of users, services and servers in whole network.
case 251:
{
if ( ! irc_network_info )
break;
{
vector<string> parts = SplitWords(params, ' ');
int users = 0;
int services = 0;
@ -240,10 +240,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
// List of users in a channel (names command).
case 353:
{
if ( ! irc_names_info )
break;
{
vector<string> parts = SplitWords(params, ' ');
if ( parts.size() < 3 )
@ -283,10 +283,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
// Count of users and services on this server.
case 255:
{
if ( ! irc_server_info )
break;
{
vector<string> parts = SplitWords(params, ' ');
int users = 0;
int services = 0;
@ -313,10 +313,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
// Count of channels.
case 254:
{
if ( ! irc_channel_info )
break;
{
vector<string> parts = SplitWords(params, ' ');
int channels = 0;
for ( size_t i = 1; i < parts.size(); ++i )
@ -355,15 +355,15 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
EnqueueConnEvent(irc_global_users, ConnVal(), val_mgr->Bool(orig),
make_intrusive<StringVal>(eop - prefix, prefix),
make_intrusive<StringVal>(++msg));
break;
}
break;
// WHOIS user reply line.
case 311:
{
if ( ! irc_whois_user_line )
break;
{
vector<string> parts = SplitWords(params, ' ');
if ( parts.size() > 1 )
@ -399,10 +399,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
// WHOIS operator reply line.
case 313:
{
if ( ! irc_whois_operator_line )
break;
{
vector<string> parts = SplitWords(params, ' ');
if ( parts.size() > 1 )
@ -421,10 +421,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
// WHOIS channel reply.
case 319:
{
if ( ! irc_whois_channel_line )
break;
{
vector<string> parts = SplitWords(params, ' ');
// Remove nick name.
@ -485,15 +485,15 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
Weird("irc_invalid_topic_reply");
return;
}
break;
}
break;
// WHO reply line.
case 352:
{
if ( ! irc_who_line )
break;
{
vector<string> parts = SplitWords(params, ' ');
if ( parts.size() < 9 )
{

View file

@ -1,8 +1,14 @@
#pragma once
// This needs to remain the first include in this file, or some defines aren't
// set correctly when netinet/tcp.h is included and the CentOS 7 build breaks.
// clang-format off
#include "zeek/net_util.h"
#include <netinet/tcp.h>
#include <sys/types.h>
#include <string>
// clang-format on
namespace zeek::analyzer::tcp
{

View file

@ -3,9 +3,9 @@
#include "zeek/iosource/Manager.h"
#include <assert.h>
#include <sys/types.h>
#include <sys/event.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include "zeek/NetVar.h"

View file

@ -21,12 +21,12 @@ typedef enum
IPv6
} IPFamily;
#include <sys/types.h>
#include <arpa/inet.h>
#include <assert.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <sys/types.h>
#ifdef HAVE_LINUX
#define __FAVOR_BSD
#endif

View file

@ -2,9 +2,9 @@
#pragma once
#include <net/if_arp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <net/if_arp.h>
#include "zeek/packet_analysis/Analyzer.h"
#include "zeek/packet_analysis/Component.h"

View file

@ -8,6 +8,8 @@
#include <set>
#include "zeek/IntrusivePtr.h"
#include "zeek/ID.h"
#include "zeek/Expr.h"
namespace zeek::detail
{

View file

@ -313,8 +313,9 @@ ValPtr ZBody::DoExec(Frame* f, int start_pc, StmtFlowType& flow)
case OP_NOP:
break;
#include "ZAM-EvalDefs.h"
// These must stay in this order or the build fails.
#include "ZAM-EvalMacros.h"
#include "ZAM-EvalDefs.h"
default:
reporter->InternalError("bad ZAM opcode");

View file

@ -28,8 +28,8 @@ bool set_affinity(int core_number)
#elif defined(__FreeBSD__)
#include <sys/cpuset.h>
#include <sys/param.h>
#include <sys/cpuset.h>
namespace zeek
{