-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
150 additions
and
118 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
openapi: 3.1.0 | ||
|
||
info: | ||
title: Capture models | ||
version: ^0.0.0 | ||
|
||
components: | ||
schemas: | ||
Capture: | ||
description: >- | ||
Container for capture settings. | ||
type: object | ||
required: [name, choice] | ||
properties: | ||
name: '../common/common.yaml#/components/x-inline/UniqueName' | ||
port_names: | ||
description: >- | ||
The unique names of ports that the capture settings will apply to. | ||
type: array | ||
items: | ||
type: string | ||
x-constraint: | ||
- '/components/schemas/Port/properties/name' | ||
choice: | ||
description: >- | ||
The type of filter. | ||
type: string | ||
enum: [basic, pcap] | ||
basic: | ||
description: >- | ||
An array of basic filters. | ||
The filters supported are source address, destination address and | ||
custom. | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Capture.BasicFilter' | ||
pcap: | ||
description: >- | ||
The content of this property must be of pcap filter syntax. | ||
https://www.tcpdump.org/manpages/pcap-filter.7.html | ||
type: string | ||
enable: | ||
description: >- | ||
Enable capture on the port. | ||
type: boolean | ||
default: True | ||
overwrite: | ||
description: >- | ||
Overwrite the capture buffer. | ||
type: boolean | ||
default: false | ||
format: | ||
description: >- | ||
The format of the capture file. | ||
type: string | ||
enum: [pcap, pcapng] | ||
default: pcap | ||
|
||
Capture.BasicFilter: | ||
description: >- | ||
A container for different types of basic capture filters. | ||
type: object | ||
required: [choice] | ||
properties: | ||
choice: | ||
type: string | ||
enum: [mac_address, custom] | ||
mac_address: | ||
$ref: '#/components/schemas/Capture.MacAddressFilter' | ||
custom: | ||
$ref: '#/components/schemas/Capture.CustomFilter' | ||
and_operator: | ||
type: boolean | ||
default: true | ||
not_operator: | ||
type: boolean | ||
default: false | ||
|
||
Capture.MacAddressFilter: | ||
description: >- | ||
A container for a mac address capture filter. | ||
type: object | ||
required: [mac, filter] | ||
properties: | ||
mac: | ||
description: >- | ||
The type of mac address filters. | ||
This can be either source or destination. | ||
type: string | ||
enum: [source, destination] | ||
filter: | ||
description: >- | ||
The value of the mac address. | ||
type: string | ||
mask: | ||
description: >- | ||
The value of the mask to be applied to the mac address. | ||
type: string | ||
|
||
Capture.CustomFilter: | ||
description: >- | ||
A container for a custom capture filter. | ||
type: object | ||
required: [filter, offset] | ||
properties: | ||
filter: | ||
description: >- | ||
The value to filter on. | ||
type: string | ||
mask: | ||
description: >- | ||
The mask to be applied to the filter. | ||
type: string | ||
offset: | ||
description: >- | ||
The offset in the packet to filter at. | ||
type: integer | ||
|
||
|
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