Defines a gNOI protocol API for PCAP feature.
RPC | Purpose |
---|---|
EnablePCAPOnInterface | Enable packet capture for the specificed interface. |
DisablePCAPOnInterface | Disable packet capture on the specified interface. |
ListEnabledInterfaces | List all interfaces enabled for packet capture. |
DeletePCAPFile | Delete the pcap file. |
StartStopPcap | Start or stop packet capture. |
RetrieveStartStopPcap | RetrieveStartStopPcap |
syntax = "proto3"; package pcap; service PacketCapture { // EnablePCAPOnInterface will enable to capture the packets for the provided interface. rpc EnablePCAPOnInterface(PcapInterface) returns (PcapResponse) {}; // DisablePCAPOnInterface will disable to capture the packets on interface rpc DisablePCAPOnInterface(InterfaceInfo) returns(PcapResponse) {}; //ListEnabledInterfaces list all the interfaces enabled for packet capture. rpc ListEnabledInterfaces(ListEnabledInterfacesRequest) returns (PcapEnabledInterfacesResponse) {}; // DeletePCAPFile delete the pcap file rpc DeletePCAPFile(DeletePcapFileRequest) returns (PcapResponse) {}; // StartStopPcap rpc StartStopPcap(StartStopPcapRequest) returns (PcapResponse) {}; // RetrieveStartStopPcap rpc RetrieveStartStopPcap(RetrieveStartStopPcapRequest) returns (RetrieveStartStopPcapResponse) {}; } message ListEnabledInterfacesRequest { } message RetrieveStartStopPcapRequest { } message PcapServiceRequest { oneof Request { PcapInterface pcap_interface = 1; InterfaceInfo interface_info = 2; ListEnabledInterfacesRequest list_enabled_interfaces_request = 3; DeletePcapFileRequest delete_pcap_file_request = 4; StartStopPcapRequest start_stop_pcap_request = 5; RetrieveStartStopPcapRequest retrieve_start_stop_pcap_request = 6; } } // It is a reusable message which has the info of interface name and type. message InterfaceInfo { //name of the interface string name = 1; //type of the interface string type = 2; } // PcapInterface is the message for the packet capture based on the interface, direction and filter message PcapInterface { InterfaceInfo interface_info = 1; enum Direction { RX = 0; TX = 1; BOTH = 2; } Direction direction = 2; int32 packet_count = 3; enum Protocol { L2 = 0; L3 = 1; ALL = 3; } Protocol protocol_info = 4; } // The PcapResponse is sent from the Target to the Client in response to the // enable or disable packet capture RPCs and for deleting PCAP file. It indicates the success //or error case message PcapResponse { oneof response { Success success = 1; Failure failure = 2; } } //The target will reply as CaptureOK message Success {} //the target will reply with Failure message if any. message Failure { string error_message =1; } //The PcapEnabledInterfacesResponse will respond with the interface info //for PCAP enabled interfaces with details about direction, packet count , protocol message PcapEnabledInterfacesResponse { repeated PcapInterface pcap_interface = 1; } //The DeletePcapFileRequest is used as request message for deleting the Pcap file // where the request contains the pcap file name. message DeletePcapFileRequest { string file_name =1; } message StartStopPcapRequest { enum StartStopEnum { start = 0; stop = 1; } StartStopEnum StartStop = 1; } message RetrieveStartStopPcapResponse { StartStopPcapRequest start_stop_pcap_request = 1; }