-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make adjustments for Zeek 4.x compatibility
- Loading branch information
Showing
11 changed files
with
22 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
|
||
#ifndef BRO_PLUGIN_DEMO_ROT13 | ||
#define BRO_PLUGIN_DEMO_ROT13 | ||
#pragma once | ||
|
||
#include <plugin/Plugin.h> | ||
#include <zeek/plugin/Plugin.h> | ||
|
||
namespace plugin { | ||
namespace Demo_Rot13 { | ||
|
||
class Plugin : public ::plugin::Plugin | ||
class Plugin : public zeek::plugin::Plugin | ||
{ | ||
protected: | ||
// Overridden from plugin::Plugin. | ||
virtual plugin::Configuration Configure(); | ||
virtual zeek::plugin::Configuration Configure(); | ||
}; | ||
|
||
extern Plugin plugin; | ||
|
||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
%%{ | ||
#include "BroString.h" | ||
#include "zeek/util.h" | ||
#include "zeek/ZeekString.h" | ||
#include "zeek/Val.h" | ||
%%} | ||
|
||
module Demo; | ||
|
||
function rot13%(s: string%) : string | ||
%{ | ||
char* rot13 = copy_string(s->CheckString()); | ||
char* rot13 = util::copy_string(s->CheckString()); | ||
|
||
for ( char* p = rot13; *p; p++ ) | ||
{ | ||
char b = islower(*p) ? 'a' : 'A'; | ||
*p = (*p - b + 13) % 26 + b; | ||
} | ||
|
||
BroString* bs = new BroString(1, reinterpret_cast<byte_vec>(rot13), | ||
strlen(rot13)); | ||
return new StringVal(bs); | ||
auto zs = new zeek::String(1, reinterpret_cast<byte_vec>(rot13), | ||
strlen(rot13)); | ||
return make_intrusive<StringVal>(zs); | ||
%} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
loaded bro-test-package plugin | ||
loaded bro-test-package scripts | ||
loaded zeek-test-package plugin | ||
loaded zeek-test-package scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Uryyb | ||
loaded bro-test-package plugin | ||
loaded zeek-test-package plugin |