GeneSIPs 1.0.8

SIPS Traffic Generation with baked in faker components.

Install-Package GeneSIPs -Version 1.0.8
dotnet add package GeneSIPs --version 1.0.8
<PackageReference Include="GeneSIPs" Version="1.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GeneSIPs --version 1.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

GeneSIPS

GeneSIPS is a simplistic library for bulk generation of SIPs datagrams.

Methodology

Since SIP Datagrams are really just text structures following IETF documents https://tools.ietf.org/html/rfc3261 and https://tools.ietf.org/html/rfc2046,
the primary goal of this library is to build the structure of the message in string format such that it can be encoded
and piped into a UDP Client.

Generation

Each class and its subclass will contain a public faker object. While the library has "general" rules defined, you can also build your own Faker<T> objects
and pass them to each class as a constructor to override the default value.

Testing

Each class (Or Line in the message) will contain its own Regex value to test for validity. As such you can bulk generate data, and then validate each line (and then the entire message)
against the regex.

Usage

The first case is just generating a datagram:

 SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();

This will provide you an actual Datagram object. If you want the raw datagram converted to test, you can just call ToString() on the object:

string Datagram = TestMessage.ToString()

Custom Fakers

I'm in the process of implementing static faker settings across all objects, but let's look at the SIPMessage object. The below allows you to create a custom Faker for the entire object that, in this case, leaves the Body null:

Faker<SIPMessage> CustomFaker = new Faker<SIPMessage>()
                .StrictMode(false)
                .RuleFor(o => o.Body, f => null)
                .RuleFor(o => o.RequestLine, f => RequestLine.Faker.Generate(1).First())
                .RuleFor(o => o.Header, f => MessageHeader.Faker.Generate(1).First());

SIPMessage.SetCustomFaker(CustomFaker);
SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();           

Bulk Generation

If you're looking at bulk-generating datagrams, you will do it via Faker.Generate(x). As a heads up, initial benchmarking was able to produce 50,000 in 2.2 seconds. Can probably be tuned down, but should also be implemented in parallel if you need large volumes.

GeneSIPS

GeneSIPS is a simplistic library for bulk generation of SIPs datagrams.

Methodology

Since SIP Datagrams are really just text structures following IETF documents https://tools.ietf.org/html/rfc3261 and https://tools.ietf.org/html/rfc2046,
the primary goal of this library is to build the structure of the message in string format such that it can be encoded
and piped into a UDP Client.

Generation

Each class and its subclass will contain a public faker object. While the library has "general" rules defined, you can also build your own Faker<T> objects
and pass them to each class as a constructor to override the default value.

Testing

Each class (Or Line in the message) will contain its own Regex value to test for validity. As such you can bulk generate data, and then validate each line (and then the entire message)
against the regex.

Usage

The first case is just generating a datagram:

 SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();

This will provide you an actual Datagram object. If you want the raw datagram converted to test, you can just call ToString() on the object:

string Datagram = TestMessage.ToString()

Custom Fakers

I'm in the process of implementing static faker settings across all objects, but let's look at the SIPMessage object. The below allows you to create a custom Faker for the entire object that, in this case, leaves the Body null:

Faker<SIPMessage> CustomFaker = new Faker<SIPMessage>()
                .StrictMode(false)
                .RuleFor(o => o.Body, f => null)
                .RuleFor(o => o.RequestLine, f => RequestLine.Faker.Generate(1).First())
                .RuleFor(o => o.Header, f => MessageHeader.Faker.Generate(1).First());

SIPMessage.SetCustomFaker(CustomFaker);
SIPMessage TestMessage = SIPMessage.Faker.Generate(1).First();           

Bulk Generation

If you're looking at bulk-generating datagrams, you will do it via Faker.Generate(x). As a heads up, initial benchmarking was able to produce 50,000 in 2.2 seconds. Can probably be tuned down, but should also be implemented in parallel if you need large volumes.

Release Notes

Updating the from field to make sure that a GUID is generated for tag when using faker to be RFC compliant

  • .NETCoreApp 2.2

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.8 275 2/13/2019
1.0.7 218 1/28/2019
1.0.6 255 1/20/2019
1.0.5 251 1/20/2019
1.0.4 261 1/20/2019
1.0.3 268 1/20/2019
1.0.2 271 1/18/2019
1.0.1 260 1/18/2019
1.0.0 279 1/16/2019