Summary

A summary for developers to access a FMADIO device using the API.

FMADIO API

The FMADIO API is simple and designed for easy scripting integration.

Note: Replace the IP 127.0.0.1 with the host IP of your FMADIO device.

Device Operation

Capture Start

GET /sysmaster/capture_start?StreamName=<capture name>

This Command starts a capture running on the device.

Query Parameters

NameTypeDescription

StreamName

string

Stream capture name

{
  "Status": true,
  "Str": "[Fri May 28 09:48:34 2021] successfully started capture [test1234]"
}

Capture Stop

GET /sysmaster/capture_stop

Stops any currently capturing process. NOTE: this does NOT stop scheduled captures.

{
    "Status":true,
    "Str":"[Mon Jul  2 11:26:13 2018] successfully stopped capture [TestCapture]"
}

Capture Status JSON format

GET /sysmaster/capture_status

Returns status of the capture in JSON format

{
  "Status": true,
  "GUIMode": "full",
  "StreamName": "capturetest",
  "CaptureEnable": "false",
  "CaptureTime": 1642057937.6518,
  "CaptureByte": 9960256568,
  "CapturePacket": 36312769,
  "CaptureBps": 687557440,
  "CapturePps": 266806.4375,
  "CurrentTime": "2022/01/13   07:12"
}

General System Status (CSV)

GET /sysmaster/status

Returns Capture status of currently active capture.

$ curl -u fmadio:100g http://192.168.2.75/sysmaster/status
uptime,                                             0D 1H 57M
packets_received,                                222652795259
packets_dropped,                                            0
packets_errors,                                        300000
packets_captured,                                222265863667
bytes_captured,                                20084978997482
bytes_pending,                                              0
bytes_disk,                                    21817945751552
bytes_overflow,                                 230924484608
bytes_overflow_now,                                            0
capture0_link,                                              up
capture0_link_uptime,                                0D 1H 57M
capture0_link_speed,                                     10000
capture1_link,                                              up
capture1_link_uptime,                                0D 1H 57M
capture1_link_speed,                                     10000
capture_bytes,                                              0
capture_packets,                                            0
capture_bps,                                                0
capture_pps,                                                0
capture_name,                                     TestCapture
capture_active,                                          true

Device Management

System Status

GET /sysmaster/stats_summary

Get system status information. Partial example output in parsed JSON format below

{
	"uptime":"0D 7H 16M",
	"packets_received":1454363817,
	"packets_dropped":0,
	"packets_errors":0,
	"packets_captured":1454363968,
	"packets_oldest":"19 May 2014 15:48:38",
	"packets_oldest_ts":"1400482118411568128",
	"capture_days":"1505D  0H 57M",
	"bytes_captured":105800185305,
	"bytes_pending":0,
	"bytes_disk":171117117440,
	"bytes_overflow":0,
	"smart_errors":0,
	"raid_errors":0,
	"raid_status":"clean : raid5",
	"stream_errors":0,
	"chunk_errors":0,
	"ecc_errors":0,
.
.
.
.
}

Delete Capture

GET /pcap/del?StreamName=<full capture name>

Deletes capture off the system

Path Parameters

NameTypeDescription

StreamName

string

full name of the capture file to be deleted

V1 API

The FMADIO V1 API uses endpoints with parameters. All V1 versions of the API endpoints shall have the format:

/api/v1/<operation>/<task>?<params=x>

The V1 API has advantages of the previous API. These are:

  • Multiple downloads can occur at the same time on the same device (up to 4 concurrently).

  • Improved download performance

  • Ability to use compressed and bpf filter parameters on most downloads.

Note: All original API url's shall be available as well as the new V1 endpoints.

Downloading PCAP

Single PCAP Download

GET /api/v1/pcap/single

Download entire capture as a single file. Piping to a file or any other analysis tools is possible.

Query Parameters

NameTypeDescription

FilterBPF

string

BPF Filter to be applied to the stream.

Compression

string

Compress the returned stream with gzip. 'fast' Fastest compression but not smallest. 'best' Slowest compression smallest size. 1-9 The range from 'fast' to 'best'

StreamName*

string

Stream capture name.

FilterFrame

String

Filter on the Packet Frame

a7130.device==<device id>

a7130.srcport==<port id>

c3550.srcport==<portid>

capture.port==<portid>

TSMode

String

Sets the Timestamp of the PCAP

nic - FMADIO FPGA timestamp

arista7130 - Arista 7130 (Metamako)

arista7150_overwrite - Arista 7150 FCS Overwrite

arista7150_insert - Arista 7150 Insert 32bit

arista7280_eth64 - Arista 7280 Ethernet 64bit header

arista7280_mac48 - Arista 7280 SrcMAC 48bit Overwrite

cisco_erspan3 - Cisco ERPSANv3

cisco3550 - Cisco 3550 (Exablaze)

FilterBPFDecap

string

true : Run BPF filter on a De-Encapsulated version of the packet

false : Run BPF on raw packet

Default: false

$ curl -u fmadio:100g "http://192.168.2.75/api/v1/pcap/single?StreamName=TestCapture_20180702_1127&&FilterBPF=tcp" | tcpdump  -r - -nn | head
11:33:08.000000 66:77:88:99:aa:bb > 00:44:44:44:44:44 Null Information, send seq 22, rcv seq 1, Flags [Poll], length 54
        0x0000:  0000 2c03 153a 2d03 153a 2e03 153a 2f03  ..,..:-..:...:/.
        0x0010:  153a 3003 153a 3103 153a 3203 153a 3303  .:0..:1..:2..:3.
        0x0020:  153a 3403 153a 3503 153a 3603 153a 3703  .:4..:5..:6..:7.
        0x0030:  153a a878 4e26                           .:.xN&
11:33:08.000000 66:77:88:99:aa:bb > 00:33:33:33:33:33 Null Information, send seq 22, rcv seq 1, Flags [Poll], length 54
        0x0000:  0000 2c03 152a 2d03 152a 2e03 152a 2f03  ..,..*-..*...*/.
        0x0010:  152a 3003 152a 3103 152a 3203 152a 3303  .*0..*1..*2..*3.
        0x0020:  152a 3403 152a 3503 152a 3603 152a 3703  .*4..*5..*6..*7.
        0x0030:  152a 7b57 491d                           .*{WI.
.
.
.
.
.   

Get Specific PCAP timerange (optional BPF filter)

GET /api/v1/pcap/splittime

Gets PCAP from the specified StreamName with Start/Stop EPOCH time with an optional BPF filter

Query Parameters

NameTypeDescription

StreamName*

String

Capture name to fetch from

Start*

String

EPOCH Nanosecond start time

Stop*

String

EPOCH Nanosecond stop time

FilterBPF

String

Escape Encoded BPF filter

FilterFrame

String

Filter on the Packet Frame

a7130.device==<device id>

a7130.srcport==<port id>

c3550.srcport==<portid>

capture.port==<portid>

TSMode

String

Sets the Timestamp of the PCAP

nic - FMADIO FPGA timestamp

arista7130 - Arista 7130 (Metamako)

arista7150_overwrite - Arista 7150 FCS Overwrite

arista7150_insert - Arista 7150 Insert 32bit

arista7280_eth64 - Arista 7280 Ethernet 64bit header

arista7280_mac48 - Arista 7280 SrcMAC 48bit Overwrite

cisco_erspan3 - Cisco ERPSANv3

cisco3550 - Cisco 3550 (Exablaze)

{
    // Response
}

TimeRange PCAP Download (optional BPF and Frame Filter)

GET /api/v1/pcap/timerange

Download a timerange of pcap data that can cross over a multiple pcap files. The timerange results may be a portion of a single pcap stream, or a portion of multiple streams that share a connected time series.

Examples

https://docs.fmad.io/fmadio-documentation/api/usage-guide#timerange-1

TSBegin and TSEnd

curl -u fmadio:xxx "http://127.0.0.1/api/v1/pcap/timerange?TSBegin=1621772572136996000&TSEnd=1621774913584264000"

TSBegin, TSEnd and FilterBPF

curl -u fmadio:xxx "http://127.0.0.1/api/v1/pcap/timerange?TSBegin=1621772572136996000&TSEnd=1621774913584264000" -G --data-urlencode "FilterBPF=tcp"

TSBegin, TSEnd, FilterBPF and Compression

curl -u fmadio:xxx "http://127.0.0.1/api/v1/pcap/timerange?TSBegin=1621772572136996000&TSEnd=1621774913584264000&Compression=fast" -G --data-urlencode "FilterBPF=tcp"

Query Parameters

NameTypeDescription

FilterBPF

string

Compression

string

Compress the returned stream with gzip. 'fast' Fastest compression but not smallest. 'best' Slowest compression smallest size. 1-9 The range from 'fast' to 'best'

TSMax

integer

Maximum nanosecond of packets to download.

TSUnit

string

Time Range mode to use for time selection

nanos : Nanoseconds (default)

msecs : Milliseconds

sec : Seconds

YYYYMMDD_HHMMSS: this year year month day hour min second time format

TSBegin*

integer

Start time in nanoseconds epoch.

TSEnd*

integer

Stop time in nanoseconds epoch.

FilterFrame

String

Filtering based on frame parameters

capture.port==0,1

(fetch data for capture ports 0 and 1 only)

capture.port!=0

(fetch data for capture ports NOT equal to 0)

a7130.srcdevice!=0

(fetch data for anything that has a valid Arista 7130 device id)

a7130.srcdevice==0

(fetch anything that does NOT have a valid Arista 7130 device id)

a7130.srcdevice=54931 and a7130.srcport=1

(fetch data only for Arista 7130 device id 54931 and Arista 7130 port id 1)

a7130.srcdevice==54931 and a7130.srcport=1,2,3,4

(fetch data for Arista 7130 device id 54931 and Arista 7130 ports 1, 2, 3, 4)

a7130.srcdevice==54931 and a7130.srcport!=1

(fetch data for Arista 7130 device ie 54931 and all ports except port 1)

TSMode

String

Sets the Timestamp of the PCAP

nic - FMADIO FPGA timestamp

arista7130 - Arista 7130 (Metamako)

arista7150_overwrite - Arista 7150 FCS Overwrite

arista7150_insert - Arista 7150 Insert 32bit

arista7280_eth64 - Arista 7280 Ethernet 64bit header

arista7280_mac48 - Arista 7280 SrcMAC 48bit Overwrite

cisco_erspan3 - Cisco ERPSANv3

cisco3550 - Cisco 3550 (Exablaze)

FilterBPFDecap

string

true : Run BPF filter on a De-Encapsulated version of the packet

false : Run BPF on raw packet

Default: false

$ curl -u fmadio:100g "http://192.168.2.75/pcap/timerange?TSBegin=1530498788000000000&TSEnd=1530498789000000000&" | tcpdump  -r - -nn | head
11:33:08.000000 66:77:88:99:aa:bb > 00:44:44:44:44:44 Null Information, send seq 22, rcv seq 1, Flags [Poll], length 54
        0x0000:  0000 2c03 153a 2d03 153a 2e03 153a 2f03  ..,..:-..:...:/.
        0x0010:  153a 3003 153a 3103 153a 3203 153a 3303  .:0..:1..:2..:3.
        0x0020:  153a 3403 153a 3503 153a 3603 153a 3703  .:4..:5..:6..:7.
        0x0030:  153a a878 4e26                           .:.xN&
11:33:08.000000 66:77:88:99:aa:bb > 00:33:33:33:33:33 Null Information, send seq 22, rcv seq 1, Flags [Poll], length 54
        0x0000:  0000 2c03 152a 2d03 152a 2e03 152a 2f03  ..,..*-..*...*/.
        0x0010:  152a 3003 152a 3103 152a 3203 152a 3303  .*0..*1..*2..*3.
        0x0020:  152a 3403 152a 3503 152a 3603 152a 3703  .*4..*5..*6..*7.
        0x0030:  152a 7b57 491d                           .*{WI.
.
.
.
.
.

System

Read the current FPGA System Time

GET /api/v1/system/time_current

Returns the current time on the fpga in epoch nanoseconds. This time/clock is used directly to timestamp packets on the FPGA.

$ curl http://127.0.0.1/api/v1/system/time_current
1652273869313808661
$

Get current system version information

GET /api/v1/system/version

Returns the current system version.

Example output:

fmadio@fmadio100v2-228U:$ curl http://127.0.0.1/api/v1/system/version {"version":"9120","device":"fmadio100v2","build":"Wed Sep 27 03:08:27 2023"} fmadio@fmadio100v2-228U:$

Get RMON1 capture port stats

GET /api/v1/system/port_stats

returns RMON1 capture port statistics

Example:

fmadio@fmadio100v2-228U:$ curl -s http://127.0.0.1/api/v1/system/port_stats | jq

{

"cap0":

{ "Pkt": 0, "Byte": 0, "Pkt_RUNT": 0, "Pkt_64": 0, "Pkt_65_127": 0, "Pkt_128_255": 0, "Pkt_256_511": 0, "Pkt_512_1023": 0, "Pkt_1024_1518": 0, "Pkt_1024_2047": 0, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"cap1":

{ "Pkt": 0, "Byte": 0, "Pkt_RUNT": 0, "Pkt_64": 0, "Pkt_65_127": 0, "Pkt_128_255": 0, "Pkt_256_511": 0, "Pkt_512_1023": 0, "Pkt_1024_1518": 0, "Pkt_1024_2047": 0, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"cap2":

{ "Pkt": 0, "Byte": 0, "Pkt_RUNT": 0, "Pkt_64": 0, "Pkt_65_127": 0, "Pkt_128_255": 0, "Pkt_256_511": 0, "Pkt_512_1023": 0, "Pkt_1024_1518": 0, "Pkt_1024_2047": 0, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"cap3":

{ "Pkt": 0, "Byte": 0, "Pkt_RUNT": 0, "Pkt_64": 0, "Pkt_65_127": 0, "Pkt_128_255": 0, "Pkt_256_511": 0, "Pkt_512_1023": 0, "Pkt_1024_1518": 0, "Pkt_1024_2047": 0, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"cap4":

{ "Pkt": 0, "Byte": 0, "Pkt_RUNT": 0, "Pkt_64": 0, "Pkt_65_127": 0, "Pkt_128_255": 0, "Pkt_256_511": 0, "Pkt_512_1023": 0, "Pkt_1024_1518": 0, "Pkt_1024_2047": 0, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"cap5":

{ "Pkt": 0, "Byte": 0, "Pkt_RUNT": 0, "Pkt_64": 0, "Pkt_65_127": 0, "Pkt_128_255": 0, "Pkt_256_511": 0, "Pkt_512_1023": 0, "Pkt_1024_1518": 0, "Pkt_1024_2047": 0, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"cap6":

{ "Pkt": 7237, "Byte": 1936022, "Pkt_RUNT": 0, "Pkt_64": 55, "Pkt_65_127": 559, "Pkt_128_255": 257, "Pkt_256_511": 6136, "Pkt_512_1023": 180, "Pkt_1024_1518": 50, "Pkt_1024_2047": 50, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"cap7":

{ "Pkt": 0, "Byte": 0, "Pkt_RUNT": 0, "Pkt_64": 0, "Pkt_65_127": 0, "Pkt_128_255": 0, "Pkt_256_511": 0, "Pkt_512_1023": 0, "Pkt_1024_1518": 0, "Pkt_1024_2047": 0, "Pkt_2048_4095": 0, "Pkt_4096_8191": 0, "Pkt_8192_9216": 0, "Pkt_OVER": 0 },

"port_config": "8x10G"

}

fmadio@fmadio100v2-228U:$

Get IO Statistics on the system

GET /api/v1/system/io_stats

Example:

fmadio@fmadio100v2-228U:$ curl -s http://127.0.0.1/api/v1/system/io_stats | jq { "timestamp": "1696925340903886080", "ioqueue_active": "1" } fmadio@fmadio100v2-228U:$

Get system status

GET /api/v1/system/status

Returns the system status, this is identical to the Telemetry data

https://docs.fmad.io/fmadio-documentation/monitoring/syslog-fmadio100gv2

Example output:

fmadio@fmadio100v2-228U:~$ curl -s http://127.0.0.1/api/v1/system/status

Resulting JSON blob

{"timestamp":1695785446,"ver":"9120","temperature":{"module":"system","subsystem":"temperature","timestamp":1695785446,"ver":"9120","Temperature_CPU0":55.00,"Temperature_CPU1":70.00,"Temperature_PCH":46.00,"Temperature_SYS":42.00,"Temperature_PER":24.00,"Temperature_NIC":49.00,"Temperature_AirIn":24.00,"Temperature_AirOut":0.00,"Temperature_Transceiver0":42.00,"Temperature_Transceiver1":42.00},"fan":{"module":"system","subsystem":"fan","timestamp":1695785446,"ver":"9120","Fan_SYS0":21450,"Fan_SYS1":21450,"Fan_SYS2":21300,"Fan_SYS3":21450,"Fan_SYS4":21450,"Fan_SYS5":21450,"Fan_SYS6":21600,"Fan_SYS7":21450},"disk":{"module":"system","subsystem":"disk","timestamp":1695785446,"ver":"9120","FreeGB_System":8.977,"FreeGB_Store0":4720.779,"FreeGB_Store1":0.000,"FreeGB_Remote0":46349.530,"FreeGB_Remote1":46349.530,"DiskPresent_os0":true,"DiskTemperature_os0":40,"DiskSMART_os0":0,"DiskPresent_ssd0":true,"DiskTemperature_ssd0":36,"DiskSMART_ssd0":0,"DiskPresent_ssd1":true,"DiskTemperature_ssd1":34,"DiskSMART_ssd1":0,"DiskPresent_ssd2":true,"DiskTemperature_ssd2":35,"DiskSMART_ssd2":0,"DiskPresent_ssd3":true,"DiskTemperature_ssd3":34,"DiskSMART_ssd3":0,"DiskPresent_ssd4":true,"DiskTemperature_ssd4":35,"DiskSMART_ssd4":0,"DiskPresent_ssd5":true,"DiskTemperature_ssd5":40,"DiskSMART_ssd5":0,"DiskPresent_ssd6":true,"DiskTemperature_ssd6":36,"DiskSMART_ssd6":0,"DiskPresent_ssd7":true,"DiskTemperature_ssd7":37,"DiskSMART_ssd7":0,"DiskPresent_par0":true,"DiskTemperature_par0":34,"DiskSMART_par0":0},"link":{"module":"system","subsystem":"link","timestamp":1695785446,"ver":"9120","cap0_link":true,"cap1_link":true,"cap2_link":true,"cap3_link":true,"cap4_link":true,"cap5_link":true,"cap6_link":true,"cap7_link":true,"man0_link":true,"man10_link":true},"io":{"module":"system","subsystem":"io","timestamp":1695785446,"ver":"9120","DiskRdGbps":0.40,"DiskWrGbps":0.25},"capture":{"module":"system","subsystem":"capture","timestamp":1695785446,"ver":"9120","CaptureEnb":true,"CapturePkt":10497009,"CaptureByte":14691374307,"CaptureDrop":0,"CaptureFCSError":0,"CaptureRateGbps":0.237402,"CaptureRateMpps":0.020893,"CaptureName":"wan_colo0_20230927_0320","CapturePort0_Byte":0,"CapturePort0_Pkt":0,"CapturePort1_Byte":14734141814,"CapturePort1_Pkt":10527209,"CapturePort2_Byte":0,"CapturePort2_Pkt":0,"CapturePort3_Byte":0,"CapturePort3_Pkt":0,"CapturePort4_Byte":0,"CapturePort4_Pkt":0,"CapturePort5_Byte":0,"CapturePort5_Pkt":0,"CapturePort6_Byte":0,"CapturePort6_Pkt":0,"CapturePort7_Byte":0,"CapturePort7_Pkt":0},"power":{"module":"system","subsystem":"power","timestamp":1695785446,"ver":"9120","PSU0_Status":false,"PSU1_Status":true,"PSU_PowerWatt":370},"other":{"module":"system","subsystem":"other","timestamp":1695785446,"ver":"9120","UptimeHour":0.33,"MemFree":352248299520,"MemErrorECC":0,"MemCached":17432817664,"MemMapped":5480136704,"MemBuffer":57147392,"MemDirty":0,"PageInByte":0,"FDCnt":1198,"WritebackB":0,"WritebackPct":0.000000,"WritebackDropTotalG":0.00,"WritebackDropG":0.00,"CacheSize":30726047137792,"StoreSize":30725994708992,"CPULoad":5.10,"SerialNo":"undef-undef-e0d55e5d2150","PortConfig":"8x10G","Version":"fmadio100v2:9120pcap2json:715"},"cat":{"module":"system","subsystem":"cat","timestamp":1695785446,"ver":"9120","cat_0_Enable":true,"cat_0_Mode":"FMADRing","cat_0_CPUMain":0,"cat_0_TSPCAP":1695785445,"cat_0_ReadPkt":21098,"cat_0_ReadByte":30071136,"cat_0_ReadTotalPkt":10510527,"cat_0_ReadTotalByte":14779806736,"cat_0_ReadGbps":0.231257,"cat_0_ReadMpps":0.020281,"cat_0_WritePkt":42196,"cat_0_WriteByte":59997961,"cat_0_WriteTotalPkt":10510527,"cat_0_WriteTotalByte":14779806736,"cat_0_WriteGbps":0.461405,"cat_0_WriteMpps":0.040563,"cat_0_PendingByte":30670848,"cat_0_PktDiscard":0,"cat_0_PktDiscardTotal":0,"cat_0_PktSlice":0,"cat_0_IOPriority":20,"cat_0_ChunkID":10996718,"cat_0_CmdLine":"/opt/fmadio/bin/stream_cat--uidpush_pcap_1695784865262465024--follow-start--nop-truncate--ring-eof--ring/opt/fmadio/queue/pcap_ring_all1sec--ring-cpu/opt/fmadio/queue/pcap_ring_all1sec23--ring-filter-bpf/opt/fmadio/queue/pcap_ring_all1sec--ring-filter-frame/opt/fmadio/queue/pcap_ring_all1sec--ring/opt/fmadio/queue/pcap_ring_icmp--ring-cpu/opt/fmadio/queue/pcap_ring_icmp23--ring-filter-bpf/opt/fmadio/queue/pcap_ring_icmpicmp--ring-filter-frame/opt/fmadio/queue/pcap_ring_icmp","cat_0_StreamName":"wan_colo0_20230927_0320","cat_0_FilterBPF":"","cat_0_CPUIdle":0.7622,"cat_0_CPUFetch":0.0154,"cat_0_CPUProcess":0.0154,"cat_0_CPUSend":0.0000,"cat_1_Enable":true,"cat_1_Mode":"FMADRing","cat_1_CPUMain":0,"cat_1_TSPCAP":1695785443,"cat_1_ReadPkt":199179,"cat_1_ReadByte":283074384,"cat_1_ReadTotalPkt":9743856,"cat_1_ReadTotalByte":13763158272,"cat_1_ReadGbps":0.226272,"cat_1_ReadMpps":0.019901,"cat_1_WritePkt":199179,"cat_1_WriteByte":281761649,"cat_1_WriteTotalPkt":9743856,"cat_1_WriteTotalByte":13763158272,"cat_1_WriteGbps":0.225223,"cat_1_WriteMpps":0.019901,"cat_1_PendingByte":33030144,"cat_1_PktDiscard":0,"cat_1_PktDiscardTotal":0,"cat_1_PktSlice":0,"cat_1_IOPriority":20,"cat_1_ChunkID":10996554,"cat_1_CmdLine":"/opt/fmadio/bin/stream_cat--uidpush_lxc_1695784924583593984--follow--ring/opt/fmadio/queue/lxc_market2json_euronext_sbe--ring-filter-bpf/opt/fmadio/queue/lxc_market2json_euronext_sbevlan177andnet224.0.208.0/24--ring-filter-frame/opt/fmadio/queue/lxc_market2json_euronext_sbe--cpu23-v--print-period10e9","cat_1_StreamName":"wan_colo0_20230927_0320","cat_1_FilterBPF":"","cat_1_CPUIdle":0.9921,"cat_1_CPUFetch":0.0071,"cat_1_CPUProcess":0.0071,"cat_1_CPUSend":0.0000,"cat_2_Enable":false,"cat_2_Mode":"","cat_2_CPUMain":0,"cat_2_TSPCAP":0,"cat_2_ReadPkt":0,"cat_2_ReadByte":0,"cat_2_ReadTotalPkt":0,"cat_2_ReadTotalByte":0,"cat_2_ReadGbps":0.000000,"cat_2_ReadMpps":0.000000,"cat_2_WritePkt":0,"cat_2_WriteByte":0,"cat_2_WriteTotalPkt":0,"cat_2_WriteTotalByte":0,"cat_2_WriteGbps":0.000000,"cat_2_WriteMpps":0.000000,"cat_2_PendingByte":0,"cat_2_PktDiscard":0,"cat_2_PktDiscardTotal":0,"cat_2_PktSlice":0,"cat_2_IOPriority":0,"cat_2_ChunkID":0,"cat_2_CmdLine":"","cat_2_StreamName":"","cat_2_FilterBPF":"","cat_2_CPUIdle":0.0000,"cat_2_CPUFetch":0.0000,"cat_2_CPUProcess":0.0000,"cat_2_CPUSend":0.0000,"cat_3_Enable":false,"cat_3_Mode":"","cat_3_CPUMain":0,"cat_3_TSPCAP":0,"cat_3_ReadPkt":0,"cat_3_ReadByte":0,"cat_3_ReadTotalPkt":0,"cat_3_ReadTotalByte":0,"cat_3_ReadGbps":0.000000,"cat_3_ReadMpps":0.000000,"cat_3_WritePkt":0,"cat_3_WriteByte":0,"cat_3_WriteTotalPkt":0,"cat_3_WriteTotalByte":0,"cat_3_WriteGbps":0.000000,"cat_3_WriteMpps":0.000000,"cat_3_PendingByte":0,"cat_3_PktDiscard":0,"cat_3_PktDiscardTotal":0,"cat_3_PktSlice":0,"cat_3_IOPriority":0,"cat_3_ChunkID":0,"cat_3_CmdLine":"","cat_3_StreamName":"","cat_3_FilterBPF":"","cat_3_CPUIdle":0.0000,"cat_3_CPUFetch":0.0000,"cat_3_CPUProcess":0.0000,"cat_3_CPUSend":0.0000,"cat_4_Enable":false,"cat_4_Mode":"","cat_4_CPUMain":0,"cat_4_TSPCAP":0,"cat_4_ReadPkt":0,"cat_4_ReadByte":0,"cat_4_ReadTotalPkt":0,"cat_4_ReadTotalByte":0,"cat_4_ReadGbps":0.000000,"cat_4_ReadMpps":0.000000,"cat_4_WritePkt":0,"cat_4_WriteByte":0,"cat_4_WriteTotalPkt":0,"cat_4_WriteTotalByte":0,"cat_4_WriteGbps":0.000000,"cat_4_WriteMpps":0.000000,"cat_4_PendingByte":0,"cat_4_PktDiscard":0,"cat_4_PktDiscardTotal":0,"cat_4_PktSlice":0,"cat_4_IOPriority":0,"cat_4_ChunkID":0,"cat_4_CmdLine":"","cat_4_StreamName":"","cat_4_FilterBPF":"","cat_4_CPUIdle":0.0000,"cat_4_CPUFetch":0.0000,"cat_4_CPUProcess":0.0000,"cat_4_CPUSend":0.0000,"cat_5_Enable":false,"cat_5_Mode":"","cat_5_CPUMain":0,"cat_5_TSPCAP":0,"cat_5_ReadPkt":0,"cat_5_ReadByte":0,"cat_5_ReadTotalPkt":0,"cat_5_ReadTotalByte":0,"cat_5_ReadGbps":0.000000,"cat_5_ReadMpps":0.000000,"cat_5_WritePkt":0,"cat_5_WriteByte":0,"cat_5_WriteTotalPkt":0,"cat_5_WriteTotalByte":0,"cat_5_WriteGbps":0.000000,"cat_5_WriteMpps":0.000000,"cat_5_PendingByte":0,"cat_5_PktDiscard":0,"cat_5_PktDiscardTotal":0,"cat_5_PktSlice":0,"cat_5_IOPriority":0,"cat_5_ChunkID":0,"cat_5_CmdLine":"","cat_5_StreamName":"","cat_5_FilterBPF":"","cat_5_CPUIdle":0.0000,"cat_5_CPUFetch":0.0000,"cat_5_CPUProcess":0.0000,"cat_5_CPUSend":0.0000,"cat_6_Enable":false,"cat_6_Mode":"","cat_6_CPUMain":0,"cat_6_TSPCAP":0,"cat_6_ReadPkt":0,"cat_6_ReadByte":0,"cat_6_ReadTotalPkt":0,"cat_6_ReadTotalByte":0,"cat_6_ReadGbps":0.000000,"cat_6_ReadMpps":0.000000,"cat_6_WritePkt":0,"cat_6_WriteByte":0,"cat_6_WriteTotalPkt":0,"cat_6_WriteTotalByte":0,"cat_6_WriteGbps":0.000000,"cat_6_WriteMpps":0.000000,"cat_6_PendingByte":0,"cat_6_PktDiscard":0,"cat_6_PktDiscardTotal":0,"cat_6_PktSlice":0,"cat_6_IOPriority":0,"cat_6_ChunkID":0,"cat_6_CmdLine":"","cat_6_StreamName":"","cat_6_FilterBPF":"","cat_6_CPUIdle":0.0000,"cat_6_CPUFetch":0.0000,"cat_6_CPUProcess":0.0000,"cat_6_CPUSend":0.0000,"cat_7_Enable":false,"cat_7_Mode":"","cat_7_CPUMain":0,"cat_7_TSPCAP":0,"cat_7_ReadPkt":0,"cat_7_ReadByte":0,"cat_7_ReadTotalPkt":0,"cat_7_ReadTotalByte":0,"cat_7_ReadGbps":0.000000,"cat_7_ReadMpps":0.000000,"cat_7_WritePkt":0,"cat_7_WriteByte":0,"cat_7_WriteTotalPkt":0,"cat_7_WriteTotalByte":0,"cat_7_WriteGbps":0.000000,"cat_7_WriteMpps":0.000000,"cat_7_PendingByte":0,"cat_7_PktDiscard":0,"cat_7_PktDiscardTotal":0,"cat_7_PktSlice":0,"cat_7_IOPriority":0,"cat_7_ChunkID":0,"cat_7_CmdLine":"","cat_7_StreamName":"","cat_7_FilterBPF":"","cat_7_CPUIdle":0.0000,"cat_7_CPUFetch":0.0000,"cat_7_CPUProcess":0.0000,"cat_7_CPUSend":0.0000,"cat_EnableCnt":2,"cat_ReadPkt":220277,"cat_ReadByte":313145520,"cat_ReadTotalPkt":20254383,"cat_ReadTotalByte":28542965008,"cat_ReadGbps":0.457529,"cat_ReadMpps":0.457529,"cat_WritePkt":241375,"cat_WriteByte":341759610,"cat_WriteTotalPkt":20254383,"cat_WriteTotalByte":28542965008,"cat_WriteGbps":0.686627,"cat_WriteMpps":0.686627},"ptp":{"module":"system","subsystem":"ptp","timestamp":1695785446,"ver":"9120","TimeFPGA":1695785446482977592,"TimeSYS":1695785446286598912,"GMOffset":0.00,"GMSync":false,"GMMaster":"","SysOffset":0.00,"SysSync":false,"iSysOffset":0.00,"iSysSync":true,"NTPOffset":0.00,"NTPSync":false,"NTPMaster":"","GMUpTime":0,"SysUptime":0,"iSysUptime":1061,"PPSUptime":690,"NTPUptime":0,"PPSPeriod":6.399925850,"PPSOffset":-867,"PPSdPhase":2065,"PPSdZero":-867,"PPSCnt":1225,"Clk156Period":0.000000,"Clk156Offset":0,"Clk250Period":0.000000,"Clk250Offset":0,"Clk322Period":0.000000,"Clk322Offset":0}}

Pretty print output

Legacy Download

NOTE: These interfaces are legacy, recommend using the V1 API interfaces

List All Captures

GET /stream/list

Lists all captures on the device.

$ curl -u fmadio:100g http://192.168.2.75/stream/list
{"Path":"/capture/","StreamList":true,"List":[
    {"id":"1","Path":"TestCapture_20180702_1127","PCAP":"/pcap/single?StreamName=TestCapture_20180702_1127&","Filter":"/en.filter.html?StreamName=TestCapture_20180702_1127&","Analytics":"/en.analytics.html?StreamName=TestCapture_20180702_1127&","TCPScope":"/en.tcpscope.html?StreamName=TestCapture_20180702_1127&","Link":"/en.files.html?Fn=view&StreamName=TestCapture_20180702_1127&","Date":1.5304988337881e+18,"Size":168169046016,"Del":"/pcap/del?StreamName=TestCapture_20180702_1127&rand=1530498848939065088&","IsActive":false,"Type":"","Desc":"Mon . 11:33:53 . 02-07-2018"},
    {"id":"2","Path":"TestCapture_20180702_1118","PCAP":"/pcap/single?StreamName=TestCapture_20180702_1118&","Filter":"/en.filter.html?StreamName=TestCapture_20180702_1118&","Analytics":"/en.analytics.html?StreamName=TestCapture_20180702_1118&","TCPScope":"/en.tcpscope.html?StreamName=TestCapture_20180702_1118&","Link":"/en.files.html?Fn=view&StreamName=TestCapture_20180702_1118&","Date":1.5304978842841e+18,"Size":0,"Del":"/pcap/del?StreamName=TestCapture_20180702_1118&rand=1530498848939096064&","IsActive":false,"Type":"","Desc":"Mon . 11:18:04 . 02-07-2018"}
]}

Split Capture by filesize

GET /stream/ssize?StreamName=<capture sname>&StreamView=<split mode>

Lists splits for a specific capture based on file size. Usually this is a 2 step process of 1) get the split list 2) download a specific split.

Query Parameters

NameTypeDescription

StreamView

string

Stream time slice name split_10MB split_100MB split_250MB split_1GB split_2GB split_5GB split_10GB split_100GB split_1TB

StreamName

string

Stream capture name

{
  "Path": "/capture/test1234_20210611_1258/split_1GB",
  "SplitFile": true,
  "CloudShark": false,
  "List": [
    {
      "id": "0",
      "Path": "20210611_12:58:47.332.461.824",
      "PCAP": "/pcap/splittime?StreamName=test1234_20210611_1258&Start=1623383927332461824ULL&Stop=1623383937678376671ULL&&",
      "Filter": "/en.filter.html?StreamName=test1234_20210611_1258&StartTS=1623383927332461824&StopTS=1623383937678376671&",
      "Date": 1623383927332500000,
      "Size": 1000079360,
      "PacketCnt": 12357055,
      "ValidPct": 100,
      "Type": "",
      "Desc": "Fri . 12:58:47 . 11-06-2021"
    },
    {
      "id": "1",
      "Path": "20210611_12:58:57.678.376.671",
      "PCAP": "/pcap/splittime?StreamName=test1234_20210611_1258&Start=1623383937678376671ULL&Stop=1623383938108305103ULL&&",
      "Filter": "/en.filter.html?StreamName=test1234_20210611_1258&StartTS=1623383937678376671&StopTS=1623383938108305103&",
      "Date": 1623383937678400000,
      "Size": 1000079360,
      "PacketCnt": 12497940,
      "ValidPct": 100,
      "Type": "",
      "Desc": "Fri . 12:58:57 . 11-06-2021"
    },
    .
    .
  }

Split Capture by time

GET /stream/stime?StreamName=<capture sname>&StreamView=<split mode>

Lists splits for a specific capture based on a time unit. Usually this is a 2 step process of 1) get the split list 2) download a specific split

Query Parameters

NameTypeDescription

StreamView

string

Split options for the time split split_1sec split_10sec split_1min split_10min split_15min split_1hour split_2hour split_4hour split_6hour split_8hour split_12hour

StreamName

string

Stream capture name.

Single PCAP Download

GET /pcap/single?StreamName=<capture name>&FilterRE=<string>

Download entire capture as a single file. Piping to a file or any other analysis tools is possible.

Compression example: curl -u fmadio:100g "http://192.168.2.75/pcap/single?StreamName=TestCapture_20180702_1127&Compression=fast"

FilterBPF example: curl -u fmadio:100g "http://192.168.2.75/pcap/single?StreamName=hitcon_20180702_1503_58&" -G --data-urlencode "FilterBPF=tcp"

Query Parameters

NameTypeDescription

FilterRE

string

Download the capture with using a RegEx DPI filter.

FilterBPF

string

BPF Filter to be applied to the stream

Compression

string

Compress the returned stream with gzip. 'fast' Fastest compression but not smallest 'best' Slowest compression smallest size 1-9 The range from 'fast' to 'best'

StreamName

string

Stream capture name.

Split PCAP Time Download

GET /pcap/splittime?StreamName=<string>&Start=<int>&Stop=<int>&FilterBPF=<string>&FilterPort=<int>

Download the capture with a time filter. Note: the nanosecond Epoch Start is 1530498788000000000. Removing the nanosecond part convert epoch to date/time.

Query Parameters

NameTypeDescription

FilterPort

integer

Download the capture specifying the port capture number.

FilterBPF

string

BPF Filter to be applied to the stream.

StreamName*

string

Stream capture name.

Stop*

integer

Stop time in nanoseconds epoch.

Start*

integer

Start time in nanoseconds epoch.

$ curl -u fmadio:100g "http://192.168.2.75/pcap/splittime?StreamName=TestCapture_20180702_1127&&Start=1530498788000000000&Stop=1530498789000000000&" | tcpdump  -r - -nn | head
11:33:08.000000 66:77:88:99:aa:bb > 00:44:44:44:44:44 Null Information, send seq 22, rcv seq 1, Flags [Poll], length 54
        0x0000:  0000 2c03 153a 2d03 153a 2e03 153a 2f03  ..,..:-..:...:/.
        0x0010:  153a 3003 153a 3103 153a 3203 153a 3303  .:0..:1..:2..:3.
        0x0020:  153a 3403 153a 3503 153a 3603 153a 3703  .:4..:5..:6..:7.
        0x0030:  153a a878 4e26                           .:.xN&
11:33:08.000000 66:77:88:99:aa:bb > 00:33:33:33:33:33 Null Information, send seq 22, rcv seq 1, Flags [Poll], length 54
        0x0000:  0000 2c03 152a 2d03 152a 2e03 152a 2f03  ..,..*-..*...*/.
        0x0010:  152a 3003 152a 3103 152a 3203 152a 3303  .*0..*1..*2..*3.
        0x0020:  152a 3403 152a 3503 152a 3603 152a 3703  .*4..*5..*6..*7.
        0x0030:  152a 7b57 491d                           .*{WI.
.
.
.
.
.

TimeRange PCAP Download

GET /pcap/timerange?TSBegin=<epoch start>&TSEnd=<epoch stop>&TSMax=<size>&TSMode=<nanos or msecs>

Download a timerange of pcap data without any capture file referenced. The system will search all captures for the specified timerange. At most it can cross two pcap files

Query Parameters

NameTypeDescription

TSMax

integer

Maximum nanosecond of packets to download.

TSMode

string

Time Range mode to use for time: nsec | epoch in nano seconds (default) usec | epoch in micro seconds msec | epoch in milli seconds sec: | epoch in seconds

TSBegin*

integer

Start time in epoch (default nano seconds)

TSEnd*

integer

Stop time in epoch (default nano seconds).

Last updated