BroEvent Class |
Namespace: BroccoliSharp
The BroEvent type exposes the following members.
Name | Description | |
---|---|---|
BroEvent(String) |
Creates a new BroEvent with the specified name.
| |
BroEvent(String, IEnumerableBroValue) |
Creates a new BroEvent with the specified name and parameters.
|
Name | Description | |
---|---|---|
AddParameter(BroValue) |
Adds a parameter to this BroEvent.
| |
AddParameter(Object, BroType, String) |
Adds a parameter with value of type to this BroEvent.
| |
AddParameters(BroValue) |
Adds specified parameters to this BroEvent.
| |
AddParameters(IEnumerableBroValue) |
Adds parameters to this BroEvent.
| |
Dispose |
Releases all the resources used by this BroEvent object.
| |
Dispose(Boolean) |
Releases the unmanaged resources used by this BroEvent object and optionally releases the managed resources.
| |
Equals | (Inherited from Object.) | |
Finalize |
Releases the unmanaged resources before this BroEvent object is reclaimed by GC.
(Overrides ObjectFinalize.) | |
GetEnumerator |
Returns an enumerator that iterates through the BroEvent parameters.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ReplaceParameter(Int32, BroValue) |
Replaces a parameter in this BroEvent.
| |
ReplaceParameter(Int32, Object, BroType, String) |
Replaces a parameter with value of type in this BroEvent.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Name |
Gets name of this BroEvent.
| |
ParameterCount |
Gets the number of parameters added to this BroEvent.
|
The BroEvent implements the .NET IEnumerableT interface with a type implementation of a BroValue to allow enumeration of the added parameters.
using (BroConnection connection = new BroConnection("bro.yourorg.com:1234")) { // Connect to remote Bro connection.Connect(); // Create a new event BroEvent bar = new BroEvent("bar"); bar.AddParameter("Text parameter"); bar.AddParameter(true); bar.AddParameter("192.168.1.1", BroType.IpAddr); bar.AddParameter(new BroPort(80, ProtocolType.Tcp)); bar.AddParameter(2, BroType.Enum, "transport_proto"); bar.AddParameter(BroTime.Now); // Send the event bool result = connection.SendEvent(bar); Console.WriteLine("Event \"bar\" {0}", result ? "was sent or queued for later delivery" : "failed to send or queue"); }
BroEvent myEvent = new BroEvent("myEvent"); BroVector list = new BroVector(); for (int i = 0; i < 10; i++) list.Add(i, BroType.Int); myEvent.AddParameter(list.Count, BroType.Int); myEvent.AddParameter(list); myEvent.AddParameter("bro.myorg.com", BroType.IpAddr); myEvent.AddParameter("MyEvent Text String"); myEvent.AddParameter(false); int counter = 0; foreach (BroValue value in myEvent) Console.WriteLine("Event value {0} = \"{1}\"", counter++, value);