mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Minor fixes for build problems after reformatting
This commit is contained in:
parent
b2f171ec69
commit
30aa4621c5
12 changed files with 231 additions and 214 deletions
8
NEWS
8
NEWS
|
@ -9,6 +9,14 @@ Zeek 4.2.0
|
||||||
New Functionality
|
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
|
Changed Functionality
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,3 @@
|
||||||
#include "zeek/EventLauncher.h"
|
#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"
|
#include "event.bif.func_def"
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
#pragma once
|
#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"
|
#include "event.bif.func_h"
|
||||||
|
|
2
src/IP.h
2
src/IP.h
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
#include <sys/types.h> // for u_char
|
|
||||||
|
|
||||||
#include "zeek/zeek-config.h"
|
#include "zeek/zeek-config.h"
|
||||||
|
|
||||||
|
|
|
@ -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.
|
// Count of users, services and servers in whole network.
|
||||||
case 251:
|
case 251:
|
||||||
|
{
|
||||||
if ( ! irc_network_info )
|
if ( ! irc_network_info )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
int users = 0;
|
int users = 0;
|
||||||
int services = 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).
|
// List of users in a channel (names command).
|
||||||
case 353:
|
case 353:
|
||||||
|
{
|
||||||
if ( ! irc_names_info )
|
if ( ! irc_names_info )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
|
|
||||||
if ( parts.size() < 3 )
|
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.
|
// Count of users and services on this server.
|
||||||
case 255:
|
case 255:
|
||||||
|
{
|
||||||
if ( ! irc_server_info )
|
if ( ! irc_server_info )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
int users = 0;
|
int users = 0;
|
||||||
int services = 0;
|
int services = 0;
|
||||||
|
@ -313,10 +313,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
|
||||||
|
|
||||||
// Count of channels.
|
// Count of channels.
|
||||||
case 254:
|
case 254:
|
||||||
|
{
|
||||||
if ( ! irc_channel_info )
|
if ( ! irc_channel_info )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
int channels = 0;
|
int channels = 0;
|
||||||
for ( size_t i = 1; i < parts.size(); ++i )
|
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),
|
EnqueueConnEvent(irc_global_users, ConnVal(), val_mgr->Bool(orig),
|
||||||
make_intrusive<StringVal>(eop - prefix, prefix),
|
make_intrusive<StringVal>(eop - prefix, prefix),
|
||||||
make_intrusive<StringVal>(++msg));
|
make_intrusive<StringVal>(++msg));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// WHOIS user reply line.
|
// WHOIS user reply line.
|
||||||
case 311:
|
case 311:
|
||||||
|
{
|
||||||
if ( ! irc_whois_user_line )
|
if ( ! irc_whois_user_line )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
|
|
||||||
if ( parts.size() > 1 )
|
if ( parts.size() > 1 )
|
||||||
|
@ -399,10 +399,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
|
||||||
|
|
||||||
// WHOIS operator reply line.
|
// WHOIS operator reply line.
|
||||||
case 313:
|
case 313:
|
||||||
|
{
|
||||||
if ( ! irc_whois_operator_line )
|
if ( ! irc_whois_operator_line )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
|
|
||||||
if ( parts.size() > 1 )
|
if ( parts.size() > 1 )
|
||||||
|
@ -421,10 +421,10 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
|
||||||
|
|
||||||
// WHOIS channel reply.
|
// WHOIS channel reply.
|
||||||
case 319:
|
case 319:
|
||||||
|
{
|
||||||
if ( ! irc_whois_channel_line )
|
if ( ! irc_whois_channel_line )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
|
|
||||||
// Remove nick name.
|
// Remove nick name.
|
||||||
|
@ -485,15 +485,15 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
|
||||||
Weird("irc_invalid_topic_reply");
|
Weird("irc_invalid_topic_reply");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// WHO reply line.
|
// WHO reply line.
|
||||||
case 352:
|
case 352:
|
||||||
|
{
|
||||||
if ( ! irc_who_line )
|
if ( ! irc_who_line )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
{
|
|
||||||
vector<string> parts = SplitWords(params, ' ');
|
vector<string> parts = SplitWords(params, ' ');
|
||||||
if ( parts.size() < 9 )
|
if ( parts.size() < 9 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
#pragma once
|
#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 <netinet/tcp.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
namespace zeek::analyzer::tcp
|
namespace zeek::analyzer::tcp
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
#include "zeek/iosource/Manager.h"
|
#include "zeek/iosource/Manager.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "zeek/NetVar.h"
|
#include "zeek/NetVar.h"
|
||||||
|
|
|
@ -21,12 +21,12 @@ typedef enum
|
||||||
IPv6
|
IPv6
|
||||||
} IPFamily;
|
} IPFamily;
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/in_systm.h>
|
#include <netinet/in_systm.h>
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#ifdef HAVE_LINUX
|
#ifdef HAVE_LINUX
|
||||||
#define __FAVOR_BSD
|
#define __FAVOR_BSD
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <net/if_arp.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <net/if_arp.h>
|
||||||
|
|
||||||
#include "zeek/packet_analysis/Analyzer.h"
|
#include "zeek/packet_analysis/Analyzer.h"
|
||||||
#include "zeek/packet_analysis/Component.h"
|
#include "zeek/packet_analysis/Component.h"
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include "zeek/IntrusivePtr.h"
|
#include "zeek/IntrusivePtr.h"
|
||||||
|
#include "zeek/ID.h"
|
||||||
|
#include "zeek/Expr.h"
|
||||||
|
|
||||||
namespace zeek::detail
|
namespace zeek::detail
|
||||||
{
|
{
|
||||||
|
|
|
@ -313,8 +313,9 @@ ValPtr ZBody::DoExec(Frame* f, int start_pc, StmtFlowType& flow)
|
||||||
case OP_NOP:
|
case OP_NOP:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#include "ZAM-EvalDefs.h"
|
// These must stay in this order or the build fails.
|
||||||
#include "ZAM-EvalMacros.h"
|
#include "ZAM-EvalMacros.h"
|
||||||
|
#include "ZAM-EvalDefs.h"
|
||||||
|
|
||||||
default:
|
default:
|
||||||
reporter->InternalError("bad ZAM opcode");
|
reporter->InternalError("bad ZAM opcode");
|
||||||
|
|
|
@ -28,8 +28,8 @@ bool set_affinity(int core_number)
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
|
|
||||||
#include <sys/cpuset.h>
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#include <sys/cpuset.h>
|
||||||
|
|
||||||
namespace zeek
|
namespace zeek
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue