Manage Profishark interfaces
/interfacesGETjson [ { "pretty_mac": "aabbccddeeff", "interface": { "name": "IOTA-10G", "mac": "aa:bb:cc:dd:ee:ff", "device_type": 17, "capture_enabled": true, "physical_state":"idle" } } ]
pretty_mac is a special format of MAC address, which is used in any other request in this API; see const.html for more informationdevice_type is a numerical value, standing for the type of the devicephysical_state == error, all other requests except for /firmware/update are forbidden/interfaces/{PRETTY_MAC}GETjson { "device_type": 17, "link_up_port_a": true, "link_up_port_b": false, "available_firmware_versions": [ { "sw_version": "0.2.3", "hw_version": "2.2.7" } ], "capture_enabled": true, "physical_state": { "state": "idle", "comment": "", "last_error_time": 47345243, "last_error": "could not enable capture" } }
physical_state.state == 'idle' && capture_enabled == falsephysical_state.state:
/interfaces/{PRETTY_MAC}/resetPOSTmessage/interfaces/{PRETTY_MAC}/capturePOSTcapture_status object json { "capture_enabled": true }message + new capture_status object/interfaces/{PRETTY_MAC}/capture/togglePOSTmessage + capture_status object/interfaces/{PRETTY_MAC}/configurationGETjson { "transmit_crc_errors": true, "keep_crc32": true, "disable_port_a": true, "disable_port_b": true, "packet_slicing_bytes": 50, "inline_mode": true, "loopback": true, "timestamps_in_packets": true, "synchronized_timestamps": true, "autonegotiation_port_a": true, "autonegotiation_port_b": false, "firmware_mode": "1g" }
null is to be passed if value is not present):
inline_modeloopbackfirmware_modeautonegotiation_port_aautonegotiation_port_bpacket_slicing_bytes == 0, it means, that slicing feature is disabled; minimum value is 60inline_mode may only be changed if capabilities.span_mode == trueloopback may only be changed if capabilities.loopback == trueautonegotiation_port_a or autonegotiation_port_b may only be changed if capabilities.autoneg_10g_1g == true and configuration.firmware_mode == 1gfirmware_mode:
capabilities.multiple_hw == true/interfaces/{PRETTY_MAC}/configurationPUTconfiguration objectmessage + new configuration objectport control/interfaces/{PRETTY_MAC}/dynamic_configurationGETjson { "capture_full_frames": true }
capture_full_frames == true, the --full-frames flag will be passed to Profishark when starting capture/interfaces/{PRETTY_MAC}/dynamic_configurationPUTdynamic_configuration objectmessage + new dynamic_configuration object/interfaces/{PRETTY_MAC}/filterGETjson { "mac": "AA:BB:CC:*:EE:FF", "ip_src": "1.1.1.1", "ip_dst": "*.2.*.2", "port_dst": "333" }
mac, ip and port fields are used to check against both SRC and DST fields of the packet, joined with ORmac_src, mac_dst… fields are used to check against the corresponding field of the packetmac and (mac_src or mac_dst) cannot appear together; the same is true for other filtersmac_src and mac_dst can appear together; only one of them is also possible; the same is true for other filtersmac and ip field families may also contain masked values:
mac examples:
aa:*:cc:dd:*:ff *:*:*:*:*:* are correct values**:bb:cc:dd:ee:ff, aa:b*:cc:dd:*e:ff are incorrect valuesip version 4 examples:
1.2.*.4, *.*.*.* are correct values192.1*.2.3, 1*2.1.2.3 are incorrect valuesip version 6 examples:
aabb:cc*:*dd::00, aabb:**::ff, **::** are correct values*::*, *:c*d:a*:*d:*::00 are incorrect valuescapabilities.filtering == true/interfaces/{PRETTY_MAC}/filterPUTfilter object
message + new filter object/interfaces/{PRETTY_MAC}/portcontrolGETjson { "port_control_a": { "gigabit_ethernet": true, "fast_ethernet_fd": true, "fast_ethernet_hd": true, "ethernet_fd": true, "ethernet_hd": true, "autonegotiation": false, "symmetric_pause": true, "asymmetric_pause": true, "prefer_master": true, "force_preferred_role": true }, "port_control_b": { "gigabit_ethernet": false, "fast_ethernet_fd": true, "fast_ethernet_hd": true, "ethernet_fd": true, "ethernet_hd": true, "autonegotiation": false, "symmetric_pause": true, "asymmetric_pause": true, "prefer_master": true, "force_preferred_role": true } }autonegotiation is false, one and only one of the following shall be true:
fast_ethernet_fdfast_ethernet_hdethernet_fdethernet_hdautonegotiation is false, gigabit_ethernet shall never be trueconfiguration.inline_mode is true, port_control_b settings are ignoredcapabilities.port_control == true/interfaces/{PRETTY_MAC}/portcontrolPUTportcontrol objectmessage + new portcontrol objectconfigurationcapabilities.port_control == true/interfaces/{PRETTY_MAC}/portsinfoGETjson [ { "label": "link_speed", "type": "general_status", "value_a": null, "value_b": "10Gbps HDX" }, ... ]
label:
Down, 10Gbps_FDX, 10Gbps_HDX, 1Gbps_FDX, 1Gbps_HDX, 100Mbps_FDX, 100Mbps_HDX, 10Mbps_FDX, 10Mbps_HDXidle_error_count can be null; it means that it should be reported as N/Atype:
capabilities.port_control == true/interfaces/{PRETTY_MAC}/capabilitiesGETjson { "basic": true, "dual_ports": true, "span_mode": true, "gps": true, "update": true, "poe": true, "sfp": true, "filtering": true, "statistics_v1": true, "statistics_v2": true, "port_control": true, "loopback": true, "phy1": true, "phy2": true, "pcap_ng": true, "slicing_length": true, "phy3": true, "multiple_hw": true, "capture_full_frames": true, "ntp_disciplined_timestamp": true, "packet_type_filter": false, "pps_resolution_5ns": true, "pps_resolution_8ns": true, "autoneg_10g_1g": true }/interfaces/{PRETTY_MAC}/sfpGETjson [ { "label": "link_up", "type": "general_information", "value_a": true, "value_b": false }, ... ]
label with their types:
type:
link_up is false on the port, it means there will be no SFP information for that port; the full default object will still be sent as a responsecapabilities.sfp == true/interfaces/{PRETTY_MAC}/packet_type_filtersGETjson { "ipv4": true, "ipv6": true, "arp": true, "tcp": true, "udp": true, "icmp": true, "igmp": true, "https": false, "http": true, "ftp": true, "dns": true, "smtp": true, "pop3": true, "dhcp": true, "ssh": false, "sip": true, "smb": true, "tcp_fin": true, "tcp_syn": true, "tcp_rst": true, "tcp_psh": false, "tcp_ack": true, "zero_window": true, "quic": true, "l2_other": true, "l4_other": false }capabilities.packet_type_filter == true/interfaces/{PRETTY_MAC}/packet_type_filtersPUTpacket_type_filters objectmessage + new packet_type_filter objectcapabilities.packet_type_filter == true/interfaces/{PRETTY_MAC}/timingGETjson { "deviation": 524280.0, "external_pps_detected": true, "gps_pps_detected": false, "gps_sync": false, "pps_output": true, "time_source": "system_pps" }
time_source:
capabilities.gps == true/interfaces/{PRETTY_MAC}/timingPUTtiming object with some restrictions:
pps_output and time_source are ignoredtime_source may not be set to the value othermessage + new timing objectconfigurationcapabilities.gps == true/interfaces/{PRETTY_MAC}/timing/pushPOSTjson { "push_time_source": "manual", "time": { "sec": 1234567, "nsec": 890123 } }
push_time_source:
push_time_source == manual, time object is required, otherwise it’s ignoredtime::sec is number of seconds passed from the epoch, time::nsec are nanoseconds of this secondcapabilities.gps == true/interfaces/{PRETTY_MAC}/statisticsGETjson { "error_code": 4, "sw_dropped_packets": 8, "hw_dropped_packets": 8, "cache_used_bytes": 15, "maximum_cache_bytes": 16, "written_bytes": 23, "written_files": 42, "timestamp_ms": 47398745629, "1g": { "link_up_ms": 123456, "link_down_ms": 7890, "port_a": { "less_than_64_packets": 1, "between_64_1518_packets": 2, "more_than_1518_packets": 3, "collisions": 4, "crc_error_packets": 5, "jabber_packets": 6, "total_bytes": 7, "total_valid_packets": 8, "total_invalid_packets": 9, "hw_dropped_packets": 10 }, "port_b": { "less_than_64_packets": 1, "between_64_1518_packets": 2, "more_than_1518_packets": 3, "collisions": 4, "crc_error_packets": 5, "jabber_packets": 6, "total_bytes": 7, "total_valid_packets": 8, "total_invalid_packets": 9, "hw_dropped_packets": 10 } }, "10g": { "port_a": { "crc_error_packets": 1, "hw_dropped_packets": 10 }, "port_b": { "crc_error_packets": 1, "hw_dropped_packets": 10 } } }
1g or 10g field can be set at one time; the other will be null explicitly/interfaces/{PRETTY_MAC}/statisticsDELETEmessage/interfaces/{PRETTY_MAC}/firmwareGETjson { "cmd_utility_v": "1.17", "profishark_api_v": "2.3.26.0", "driver_v": "1.9.34.0", "sw_firmware_v": "0.2.3.46", "hw_firmware_v": "0319" }/interfaces/{PRETTY_MAC}/firmware/updateGETjson [ { "sw_version": "0.2.3", "hw_version": "2.2.7" } ]/interfaces/{PRETTY_MAC}/firmware/updatePOSTversions object defined upwardsmessage + versions objectstate.physical_state == "idle" && general_state.state == "idle", see General stateauto-start capture on boot flag value
/interfaces/{PRETTY_MAC}/capture/auto_start_on_bootGETjson { "message":"Success", "data": { "auto_start_on_boot":false } }/interfaces/{PRETTY_MAC}/capture/auto_start_on_bootPUTjson { "auto_start_on_boot": true }json { "message":"Success", "data": { "auto_start_on_boot": true } }