source_file
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "collections"
:: "::"
identifier "HashMap"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "std"
:: "::"
identifier "net"
:: "::"
use_list
{ "{"
identifier "IpAddr"
, ","
identifier "Ipv4Addr"
, ","
identifier "Ipv6Addr"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "std"
:: "::"
identifier "sync"
:: "::"
use_list
{ "{"
identifier "Arc"
, ","
identifier "Mutex"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "etherparse"
:: "::"
use_list
{ "{"
identifier "EtherType"
, ","
identifier "LaxPacketHeaders"
, ","
identifier "LinkHeader"
, ","
identifier "NetHeaders"
, ","
identifier "TransportHeader"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "pcap"
:: "::"
identifier "Address"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "parse_packets"
:: "::"
identifier "AddressesResolutionState"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "address_port_pair"
:: "::"
identifier "AddressPortPair"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "arp_type"
:: "::"
identifier "ArpType"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "bogon"
:: "::"
identifier "is_bogon"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "capture_context"
:: "::"
identifier "CaptureSource"
; ";"
use_declaration (+23 nodes collapsed)
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "info_address_port_pair"
:: "::"
identifier "InfoAddressPortPair"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "info_traffic"
:: "::"
identifier "InfoTrafficMessage"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "packet_filters_fields"
:: "::"
identifier "PacketFiltersFields"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "service"
:: "::"
identifier "Service"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "service_query"
:: "::"
identifier "ServiceQuery"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "traffic_direction"
:: "::"
identifier "TrafficDirection"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "networking"
:: "::"
identifier "types"
:: "::"
identifier "traffic_type"
:: "::"
identifier "TrafficType"
; ";"
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
identifier "IpVersion"
, ","
identifier "Protocol"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "fmt"
:: "::"
identifier "Write"
; ";"
expression_statement (+27 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Calls methods to analyze link, network, and transport heade"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns the relevant collected information.\n"
function_item (+278 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This function analyzes the data link layer header passed as"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " passed by reference on the basis of the packet header conte"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns false if packet has to be skipped.\n"
function_item (+146 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This function analyzes the network layer header passed as p"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " passed by reference on the basis of the packet header conte"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns false if packet has to be skipped.\n"
function_item (+656 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This function analyzes the transport layer header passed as"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " passed by reference on the basis of the packet header conte"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns false if packet has to be skipped.\n"
function_item (+339 nodes collapsed)
function_item (+416 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Function to insert the source and destination of a packet i"...
attribute_item
# "#"
[ "["
attribute
identifier "allow"
token_tree
( "("
identifier "clippy"
:: "::"
identifier "too_many_arguments"
) ")"
] "]"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "modify_or_insert_in_map"
parameters (+77 nodes collapsed)
-> "->"
tuple_type
( "("
type_identifier "TrafficDirection"
, ","
type_identifier "Service"
) ")"
block
{ "{"
let_declaration
let "let"
mutable_specifier "mut"
identifier "traffic_direction"
= "="
call_expression
scoped_identifier
identifier "TrafficDirection"
:: "::"
identifier "default"
arguments
( "("
) ")"
; ";"
let_declaration
let "let"
mutable_specifier "mut"
identifier "service"
= "="
scoped_identifier
identifier "Service"
:: "::"
identifier "Unknown"
; ";"
expression_statement (+174 nodes collapsed)
let_declaration
let "let"
identifier "timestamp"
= "="
field_expression
identifier "info_traffic_msg"
. "."
field_identifier "last_packet_timestamp"
; ";"
let_declaration (+357 nodes collapsed)
tuple_expression
( "("
field_expression
identifier "new_info"
. "."
field_identifier "traffic_direction"
, ","
field_expression
identifier "new_info"
. "."
field_identifier "service"
) ")"
} "}"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns the traffic direction observed (incoming or outgoin"...
function_item (+369 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Returns the traffic type observed (unicast, multicast or br"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " It refers to the remote host\n"
function_item (+110 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Determines if the input address is a broadcast address or n"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " # Arguments\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment "\n"
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " * `address` - string representing an IPv4 or IPv6 network a"...
function_item (+167 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Determines if the connection is local\n"
function_item (+522 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Determines if the address passed as parameter belong to the"...
function_item (+72 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " Converts a MAC address in its hexadecimal form\n"
function_item (+73 nodes collapsed)
function_item (+55 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "cfg"
token_tree
( "("
identifier "test"
) ")"
] "]"
mod_item (+13697 nodes collapsed)