Skip to content

Commit

Permalink
zeekGH-239: Rename bro to zeek, bro-config to zeek-config, and bro-pa…
Browse files Browse the repository at this point in the history
…th-dev to zeek-path-dev.

This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

zeek#239
  • Loading branch information
rsmmr committed May 1, 2019
1 parent 375b151 commit 789cb37
Show file tree
Hide file tree
Showing 1,119 changed files with 1,692 additions and 1,653 deletions.
41 changes: 24 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ get_filename_component(BRO_SCRIPT_INSTALL_PATH ${BRO_SCRIPT_INSTALL_PATH}

set(BRO_PLUGIN_INSTALL_PATH ${BRO_ROOT_DIR}/lib/bro/plugins CACHE STRING "Installation path for plugins" FORCE)

configure_file(bro-path-dev.in ${CMAKE_CURRENT_BINARY_DIR}/bro-path-dev)
configure_file(zeek-path-dev.in ${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev)

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bro-path-dev.sh
"export BROPATH=`${CMAKE_CURRENT_BINARY_DIR}/bro-path-dev`\n"
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev.sh
"export BROPATH=`${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev`\n"
"export BRO_PLUGIN_PATH=\"${CMAKE_CURRENT_BINARY_DIR}/src\":${BRO_PLUGIN_PATH}\n"
"export PATH=\"${CMAKE_CURRENT_BINARY_DIR}/src\":$PATH\n")

file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bro-path-dev.csh
"setenv BROPATH `${CMAKE_CURRENT_BINARY_DIR}/bro-path-dev`\n"
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev.csh
"setenv BROPATH `${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev`\n"
"setenv BRO_PLUGIN_PATH \"${CMAKE_CURRENT_BINARY_DIR}/src\":${BRO_PLUGIN_PATH}\n"
"setenv PATH \"${CMAKE_CURRENT_BINARY_DIR}/src\":$PATH\n")

Expand Down Expand Up @@ -254,36 +254,43 @@ if ( NOT BINARY_PACKAGING_MODE )
endif ()

string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bro-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/bro-config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/zeek-config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bro-config.h DESTINATION include/bro)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zeek-config.h DESTINATION include/bro)

if ( CAF_ROOT_DIR )
set(BRO_CONFIG_CAF_ROOT_DIR ${CAF_ROOT_DIR})
set(ZEEK_CONFIG_CAF_ROOT_DIR ${CAF_ROOT_DIR})
else ()
set(BRO_CONFIG_CAF_ROOT_DIR ${BRO_ROOT_DIR})
set(ZEEK_CONFIG_CAF_ROOT_DIR ${BRO_ROOT_DIR})
endif ()

if ( BinPAC_ROOT_DIR )
set(BRO_CONFIG_BINPAC_ROOT_DIR ${BinPAC_ROOT_DIR})
set(ZEEK_CONFIG_BINPAC_ROOT_DIR ${BinPAC_ROOT_DIR})
else ()
set(BRO_CONFIG_BINPAC_ROOT_DIR ${BRO_ROOT_DIR})
set(ZEEK_CONFIG_BINPAC_ROOT_DIR ${BRO_ROOT_DIR})
endif ()

if ( BROKER_ROOT_DIR )
set(BRO_CONFIG_BROKER_ROOT_DIR ${BROKER_ROOT_DIR})
set(ZEEK_CONFIG_BROKER_ROOT_DIR ${BROKER_ROOT_DIR})
else ()
set(BRO_CONFIG_BROKER_ROOT_DIR ${BRO_ROOT_DIR})
set(ZEEK_CONFIG_BROKER_ROOT_DIR ${BRO_ROOT_DIR})
endif ()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bro-config.in
${CMAKE_CURRENT_BINARY_DIR}/bro-config @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/bro-config DESTINATION bin)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-config.in
${CMAKE_CURRENT_BINARY_DIR}/zeek-config @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zeek-config DESTINATION bin)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake DESTINATION share/bro
USE_SOURCE_PERMISSIONS)

# Install wrapper script for Bro-to-Zeek renaming.
include(InstallShellScript)
include(InstallSymlink)
InstallShellScript("bin" "zeek-wrapper.in" "zeek-wrapper")
InstallSymlink("${CMAKE_INSTALL_PREFIX}/bin/zeek-wrapper" "${CMAKE_INSTALL_PREFIX}/bin/bro-config")
InstallSymlink("${CMAKE_INSTALL_PREFIX}/include/bro/zeek-config.h" "${CMAKE_INSTALL_PREFIX}/include/bro/bro-config.h")

########################################################################
## Recurse on sub-directories

Expand Down
2 changes: 1 addition & 1 deletion doc
Submodule doc updated from 856db2 to d9cf0d
File renamed without changes.
2 changes: 1 addition & 1 deletion scripts/policy/frameworks/control/controllee.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
##! to the specific analysis scripts desired. It may also need a node
##! configured as a controller node in the communications nodes configuration::
##!
##! bro <scripts> frameworks/control/controllee
##! zeek <scripts> frameworks/control/controllee

@load base/frameworks/control
@load base/frameworks/broker
Expand Down
2 changes: 1 addition & 1 deletion scripts/policy/frameworks/control/controller.zeek
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
##!
##! It's intended to be used from the command line like this::
##!
##! bro <scripts> frameworks/control/controller Control::host=<host_addr> Control::host_port=<host_port> Control::cmd=<command> [Control::arg=<arg>]
##! zeek <scripts> frameworks/control/controller Control::host=<host_addr> Control::host_port=<host_port> Control::cmd=<command> [Control::arg=<arg>]

@load base/frameworks/control
@load base/frameworks/broker
Expand Down
2 changes: 1 addition & 1 deletion src/Attr.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "Attr.h"
#include "Expr.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Base64.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "bro-config.h"
#include "zeek-config.h"
#include "Base64.h"
#include <math.h>

Expand Down
2 changes: 1 addition & 1 deletion src/BroString.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include <algorithm>
#include <ctype.h>
Expand Down
2 changes: 1 addition & 1 deletion src/CCL.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "CCL.h"
#include "RE.h"
Expand Down
28 changes: 16 additions & 12 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,24 +353,28 @@ set(bro_SRCS
collect_headers(bro_HEADERS ${bro_SRCS})

if ( bro_HAVE_OBJECT_LIBRARIES )
add_executable(bro ${bro_SRCS} ${bro_HEADERS} ${bro_SUBDIRS})
target_link_libraries(bro ${brodeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
add_executable(zeek ${bro_SRCS} ${bro_HEADERS} ${bro_SUBDIRS})
target_link_libraries(zeek ${brodeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
else ()
add_executable(bro ${bro_SRCS} ${bro_HEADERS})
target_link_libraries(bro ${bro_SUBDIRS} ${brodeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
add_executable(zeek ${bro_SRCS} ${bro_HEADERS})
target_link_libraries(zeek ${bro_SUBDIRS} ${brodeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
endif ()

if ( NOT "${bro_LINKER_FLAGS}" STREQUAL "" )
set_target_properties(bro PROPERTIES LINK_FLAGS "${bro_LINKER_FLAGS}")
set_target_properties(zeek PROPERTIES LINK_FLAGS "${bro_LINKER_FLAGS}")
endif ()

install(TARGETS bro DESTINATION bin)
install(TARGETS zeek DESTINATION bin)

set(BRO_EXE bro
CACHE STRING "Bro executable binary" FORCE)
# Install wrapper script for Bro-to-Zeek renaming.
include(InstallSymlink)
InstallSymlink("${CMAKE_INSTALL_PREFIX}/bin/zeek-wrapper" "${CMAKE_INSTALL_PREFIX}/bin/bro")

set(BRO_EXE_PATH ${CMAKE_CURRENT_BINARY_DIR}/bro
CACHE STRING "Path to Bro executable binary" FORCE)
set(BRO_EXE zeek
CACHE STRING "Zeek executable binary" FORCE)

set(BRO_EXE_PATH ${CMAKE_CURRENT_BINARY_DIR}/zeek
CACHE STRING "Path to Zeek executable binary" FORCE)

# Target to create all the autogenerated files.
add_custom_target(generate_outputs_stage1)
Expand All @@ -389,12 +393,12 @@ add_dependencies(generate_outputs generate_outputs_stage2a generate_outputs_stag
# Build __load__.zeek files for standard *.bif.zeek.
bro_bif_create_loader(bif_loader "${bro_BASE_BIF_SCRIPTS}")
add_dependencies(bif_loader ${bro_SUBDIRS})
add_dependencies(bro bif_loader)
add_dependencies(zeek bif_loader)

# Build __load__.zeek files for plugins/*.bif.zeek.
bro_bif_create_loader(bif_loader_plugins "${bro_PLUGIN_BIF_SCRIPTS}")
add_dependencies(bif_loader_plugins ${bro_SUBDIRS})
add_dependencies(bro bif_loader_plugins)
add_dependencies(zeek bif_loader_plugins)

# Install *.bif.zeek.
install(DIRECTORY ${CMAKE_BINARY_DIR}/scripts/base/bif DESTINATION ${BRO_SCRIPT_INSTALL_PATH}/base)
Expand Down
2 changes: 1 addition & 1 deletion src/ChunkedIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <algorithm>

#include "bro-config.h"
#include "zeek-config.h"
#include "ChunkedIO.h"
#include "NetVar.h"
#include "RemoteSerializer.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ChunkedIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef CHUNKEDIO_H
#define CHUNKEDIO_H

#include "bro-config.h"
#include "zeek-config.h"
#include "List.h"
#include "util.h"
#include "Flare.h"
Expand Down
2 changes: 1 addition & 1 deletion src/CompHash.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "CompHash.h"
#include "Val.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Conn.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include <ctype.h>

Expand Down
2 changes: 1 addition & 1 deletion src/DFA.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "EquivClass.h"
#include "DFA.h"
Expand Down
2 changes: 1 addition & 1 deletion src/DNS_Mgr.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include <sys/types.h>
#include <sys/socket.h>
Expand Down
2 changes: 1 addition & 1 deletion src/DbgBreakpoint.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Implementation of breakpoints.

#include "bro-config.h"
#include "zeek-config.h"

#include <assert.h>

Expand Down
2 changes: 1 addition & 1 deletion src/DbgHelp.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Bro Debugger Help

#include "bro-config.h"
#include "zeek-config.h"

#include "Debug.h"
2 changes: 1 addition & 1 deletion src/DbgWatch.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Implementation of watches

#include "bro-config.h"
#include "zeek-config.h"

#include "Debug.h"
#include "DbgWatch.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Debug.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Debugging support for Bro policy files.

#include "bro-config.h"
#include "zeek-config.h"

#include <stdio.h>
#include <stdarg.h>
Expand Down
2 changes: 1 addition & 1 deletion src/DebugCmds.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Support routines to help deal with Bro debugging commands and
// implementation of most commands.

#include "bro-config.h"
#include "zeek-config.h"

#include <sys/types.h>

Expand Down
2 changes: 1 addition & 1 deletion src/Desc.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include <stdlib.h>
#include <errno.h>
Expand Down
2 changes: 1 addition & 1 deletion src/Dict.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#ifdef HAVE_MEMORY_H
#include <memory.h>
Expand Down
2 changes: 1 addition & 1 deletion src/Discard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <algorithm>

#include "bro-config.h"
#include "zeek-config.h"

#include "Net.h"
#include "Var.h"
Expand Down
2 changes: 1 addition & 1 deletion src/EquivClass.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "EquivClass.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Event.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "Event.h"
#include "Func.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Expr.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "Expr.h"
#include "Event.h"
Expand Down
2 changes: 1 addition & 1 deletion src/File.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include <sys/types.h>
#ifdef TIME_WITH_SYS_TIME
Expand Down
2 changes: 1 addition & 1 deletion src/Frag.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "util.h"
#include "Hash.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Frame.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "Frame.h"
#include "Stmt.h"
Expand Down
2 changes: 1 addition & 1 deletion src/Func.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include <sys/types.h>
#include <sys/stat.h>
Expand Down
2 changes: 1 addition & 1 deletion src/Hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// for the adversary to construct conflicts, though I do not know if
// HMAC/MD5 is provably universal.

#include "bro-config.h"
#include "zeek-config.h"

#include "Hash.h"
#include "Reporter.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ID.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "ID.h"
#include "Expr.h"
Expand Down
2 changes: 1 addition & 1 deletion src/IP.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef ip_h
#define ip_h

#include "bro-config.h"
#include "zeek-config.h"
#include "net_util.h"
#include "IPAddr.h"
#include "Reporter.h"
Expand Down
2 changes: 1 addition & 1 deletion src/IntSet.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "bro-config.h"
#include "zeek-config.h"

#ifdef HAVE_MEMORY_H
#include <memory.h>
Expand Down
2 changes: 1 addition & 1 deletion src/List.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "bro-config.h"
#include "zeek-config.h"

#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/NFA.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See the file "COPYING" in the main distribution directory for copyright.

#include "bro-config.h"
#include "zeek-config.h"

#include "NFA.h"
#include "EquivClass.h"
Expand Down
Loading

0 comments on commit 789cb37

Please sign in to comment.