Band-aid to get Broxygen's bif documentation back.

We'll need a different approach here eventually.
This commit is contained in:
Robin Sommer 2013-05-16 16:57:49 -07:00
parent 8752870967
commit 11fd12b18e
7 changed files with 72 additions and 65 deletions

View file

@ -46,7 +46,7 @@ macro(REST_TARGET srcDir broInput)
set(sumTextSrc ${absSrcPath})
set(ogSourceFile ${absSrcPath})
if (${extension} STREQUAL ".bif.bro")
set(ogSourceFile ${BIF_SRC_DIR}/${basename})
# set(ogSourceFile ${BIF_SRC_DIR}/${basename})
# the summary text is taken at configure time, but .bif.bro files
# may not have been generated yet, so read .bif file instead
set(sumTextSrc ${ogSourceFile})
@ -70,7 +70,7 @@ macro(REST_TARGET srcDir broInput)
if (NOT "${ARGN}" STREQUAL "")
set(group ${ARGN})
elseif (${extension} STREQUAL ".bif.bro")
elseif (${broInput} MATCHES "\\.bif\\.bro$")
set(group bifs)
elseif (relDstDir)
set(group ${relDstDir}/index)
@ -86,6 +86,8 @@ macro(REST_TARGET srcDir broInput)
set(group "")
endif ()
message("${broInput} ${extension} -> ${group}")
if (NOT "${group}" STREQUAL "")
# add group to master group list if not already in it
list(FIND MASTER_GROUP_LIST ${group} _found)

View file

@ -16,61 +16,61 @@ rest_target(${CMAKE_CURRENT_SOURCE_DIR} example.bro internal)
rest_target(${psd} base/init-default.bro internal)
rest_target(${psd} base/init-bare.bro internal)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/analyzer.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/arp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ayiya/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/backdoor/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/bittorrent/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/conn-size/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/dce-rpc/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/dhcp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/dns/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/file/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/finger/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ftp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ftp/functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/gnutella/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/gtpv1/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/http/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/http/functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/icmp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ident/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/interconn/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/irc/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/login/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/login/functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/mime/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/modbus/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ncp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/netbios/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/netbios/functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/netflow/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ntp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/pia/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/pop3/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/rpc/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/smb/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/smtp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/smtp/functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/socks/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ssh/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ssl/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/ssl/functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/stepping-stone/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/syslog/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/tcp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/tcp/functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/teredo/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/udp/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/analyzer/protocol/zip/events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/bro.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/const.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/event.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/input.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/logging.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/reporter.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/strings.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/src base/types.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/analyzer.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/bro.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/const.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/event.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/input.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/logging.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_ARP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_AYIYA.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_BackDoor.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_BitTorrent.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_ConnSize.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_DCE_RPC.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_DHCP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_DNS.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_FTP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_FTP.functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_File.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Finger.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_GTPv1.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Gnutella.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_HTTP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_HTTP.functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_ICMP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_IRC.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Ident.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_InterConn.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Login.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Login.functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_MIME.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Modbus.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_NCP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_NTP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_NetBIOS.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_NetBIOS.functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_NetFlow.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_PIA.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_POP3.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_RPC.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SMB.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SMTP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SMTP.functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SOCKS.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SSH.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SSL.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SSL.functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_SteppingStone.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Syslog.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_TCP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_TCP.functions.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_Teredo.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_UDP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/plugins/Bro_ZIP.events.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/reporter.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/strings.bif.bro)
rest_target(${CMAKE_BINARY_DIR}/scripts base/bif/types.bif.bro)
rest_target(${psd} base/frameworks/analyzer/main.bro)
rest_target(${psd} base/frameworks/cluster/main.bro)
rest_target(${psd} base/frameworks/cluster/nodes/manager.bro)

View file

@ -67,12 +67,12 @@ sourcedir=${thisdir}/../..
echo "$statictext" > $outfile
bifs=`( cd ${sourcedir}/src && find . -name \*\.bif | sort )`
bifs=`( cd ${sourcedir}/build/scripts/base && find . -name \*\.bif.bro | sort )`
for file in $bifs
do
f=${file:2}.bro
echo "rest_target(\${CMAKE_BINARY_DIR}/src base/$f)" >> $outfile
f=${file:2}
echo "rest_target(\${CMAKE_BINARY_DIR}/scripts base/$f)" >> $outfile
done
scriptfiles=`( cd ${sourcedir}/scripts && find . -name \*\.bro | sort )`

View file

@ -35,12 +35,14 @@ BroDoc::BroDoc(const std::string& rel, const std::string& abs)
downloadable_filename = source_filename;
#if 0
size_t ext_pos = downloadable_filename.find(".bif.bro");
if ( std::string::npos != ext_pos )
downloadable_filename.erase(ext_pos + 4);
#endif
reST_filename = doc_title;
ext_pos = reST_filename.find(".bro");
size_t ext_pos = reST_filename.find(".bro");
if ( std::string::npos == ext_pos )
reST_filename += ".rst";

View file

@ -30,7 +30,7 @@
#define BRO_PLUGIN_VERSION(x) SetVersion(x)
#define BRO_PLUGIN_BIF_FILE(file) \
std::list<std::pair<const char*, int> > __bif_##file##_init(); \
extern std::list<std::pair<const char*, int> > __bif_##file##_init(); \
AddBifInitFunction(&__bif_##file##_init);
#define BRO_PLUGIN_ANALYZER(tag, cls) \

View file

@ -1,3 +1,4 @@
#define BRO_SCRIPT_INSTALL_PATH "@BRO_SCRIPT_INSTALL_PATH@"
#define BRO_SCRIPT_SOURCE_PATH "@BRO_SCRIPT_SOURCE_PATH@"
#define BRO_BUILD_PATH "@CMAKE_CURRENT_BINARY_DIR@"
#define BRO_BUILD_SOURCE_PATH "@CMAKE_BINARY_DIR@/src"
#define BRO_BUILD_SCRIPTS_PATH "@CMAKE_BINARY_DIR@/scripts"

View file

@ -1024,8 +1024,10 @@ void get_script_subpath(const std::string& full_filename, const char** subpath)
my_subpath.erase(0, strlen(BRO_SCRIPT_INSTALL_PATH));
else if ( (p = my_subpath.find(BRO_SCRIPT_SOURCE_PATH)) != std::string::npos )
my_subpath.erase(0, strlen(BRO_SCRIPT_SOURCE_PATH));
else if ( (p = my_subpath.find(BRO_BUILD_PATH)) != std::string::npos )
my_subpath.erase(0, strlen(BRO_BUILD_PATH));
else if ( (p = my_subpath.find(BRO_BUILD_SOURCE_PATH)) != std::string::npos )
my_subpath.erase(0, strlen(BRO_BUILD_SOURCE_PATH));
else if ( (p = my_subpath.find(BRO_BUILD_SCRIPTS_PATH)) != std::string::npos )
my_subpath.erase(0, strlen(BRO_BUILD_SCRIPTS_PATH));
// if root path found, remove path separators until next path component
if ( p != std::string::npos )