Struct Chunk

Source
pub struct Chunk {
Show 32 fields pub ip_protocol_family: u8, pub ip_protocol_id: u8, pub ipv4_src_address: Ipv4Addr, pub ipv4_dst_address: Ipv4Addr, pub ipv6_src_address: Ipv6Addr, pub ipv6_dst_address: Ipv6Addr, pub proto_src_port: u16, pub proto_dst_port: u16, pub timestamp_seconds: u32, pub timestamp_micro_seconds_offset: u32, pub proto_type: CapProtoType, pub capture_agent_id: u32, pub keep_alive_timer: u16, pub authenticate_key: String, pub packet_payload: String, pub compressed_payload: String, pub internal_correlation_id: String, pub vlan_id: u16, pub group_id: String, pub src_mac: u64, pub dst_mac: u64, pub ethernet_type: u16, pub tcp_flag: u8, pub ip_tos: u8, pub mos_value: u16, pub rfactor: u16, pub geo_location: String, pub jitter: u32, pub translation_type: String, pub payload_json_keys: String, pub tags_values: String, pub type_of_tag: String,
}
Expand description

Chunk types with chunk vendor ID 0x0000 are called generic chunk types. The following

generic chunk types are defined: 1 uint8 IP protocol family

2 uint8 IP protocol ID

3 inet4-addr IPv4 source address

4 inet4-addr IPv4 destination address

5 inet6-addr IPv6 source address

6 inet6-addr IPv6 destination address

7 uint16 protocol source port (UDP, TCP, SCTP)

8 uint16 protocol destination port (UDP, TCP, SCTP)

9 uint32 timestamp, seconds since 01/01/1970 (epoch)

10 uint32 timestamp microseconds offset (added to timestamp)

11 uint8 protocol type (SIP/H323/RTP/MGCP/M2UA)

12 uint32 capture agent ID (202, 1201, 2033…)

13 uint16 keep alive timer (sec)Capture protocol types (0x00b)

14 octet-string authenticate key (plain text / TLS connection)

15 octet-string captured packet payload

16 octet-string captured compressed payload (gzip/inflate)

17 octet-string Internal correlation id

18 uint16 Vlan ID

19 octet-string Group ID

20 uint64 Source MAC

21 uint64 Destination MAC

22 uint16 Ethernet Type

23 uint8 TCP Flag [SYN.PUSH…]

24 uint8 IP TOS ….. ….. …… 31 Reserved

32 uint16 MOS value

33 uint16 R-Factor

34 octet-string GEO Location

35 uint32 Jitter

36 octet-string Transaction type [call, registration]

37 octet-string Payload JSON Keys

38 octet-string Tags’ values

39 uint16 Type of tag

Fields§

§ip_protocol_family: u8§ip_protocol_id: u8§ipv4_src_address: Ipv4Addr§ipv4_dst_address: Ipv4Addr§ipv6_src_address: Ipv6Addr§ipv6_dst_address: Ipv6Addr§proto_src_port: u16§proto_dst_port: u16§timestamp_seconds: u32§timestamp_micro_seconds_offset: u32§proto_type: CapProtoType§capture_agent_id: u32§keep_alive_timer: u16§authenticate_key: String§packet_payload: String§compressed_payload: String§internal_correlation_id: String§vlan_id: u16§group_id: String§src_mac: u64§dst_mac: u64§ethernet_type: u16§tcp_flag: u8§ip_tos: u8§mos_value: u16§rfactor: u16§geo_location: String§jitter: u32§translation_type: String§payload_json_keys: String§tags_values: String§type_of_tag: String

Implementations§

Source§

impl Chunk

Source

pub fn new() -> Chunk

Source§

impl Chunk

Source

pub fn set_ip_protocol_family(&mut self, ip_protocol_family: u8) -> &mut Chunk

set Chunk types of IpProtocolFamily

use hep::Chunk;
 
let mut chunks = Chunk::new();
chunks.set_ip_protocol_family(1);

println!("{:?}",chunks);
Source

pub fn set_ip_protocol_id(&mut self, ip_protocol_id: u8) -> &mut Chunk

set Chunk types of IpProtocolId

Source

pub fn set_ipv4_src_address(&mut self, ipv4_src_address: Ipv4Addr) -> &mut Chunk

set Chunk types of Ipv4SrcAddress

Source

pub fn set_ipv4_dst_address(&mut self, ipv4_dst_address: Ipv4Addr) -> &mut Chunk

set Chunk types of Ipv4DstAddress

Source

pub fn set_ipv6_src_address(&mut self, ipv6_src_address: Ipv6Addr) -> &mut Chunk

set Chunk types of Ipv6SrcAddress

Source

pub fn set_ipv6_dst_address(&mut self, ipv6_dst_address: Ipv6Addr) -> &mut Chunk

set Chunk types of Ipv6DstAddress

Source

pub fn set_proto_src_port(&mut self, proto_src_port: u16) -> &mut Chunk

set Chunk types of ProtoSrcPort

Source

pub fn set_proto_dst_port(&mut self, proto_dst_port: u16) -> &mut Chunk

set Chunk types of ProtoDstPort

Source

pub fn set_timestamp_seconds(&mut self, timestamp_seconds: u32) -> &mut Chunk

set Chunk types of Timestamp_Seconds

Source

pub fn set_timestamp_micro_seconds_offset( &mut self, timestamp_micro_seconds_offset: u32, ) -> &mut Chunk

set Chunk types of TimestampMicroSecondsOffset

Source

pub fn set_proto_type(&mut self, proto_type: CapProtoType) -> &mut Chunk

set Chunk types of ProtoType

Source

pub fn set_capture_agent_id(&mut self, capture_agent_id: u32) -> &mut Chunk

set Chunk types of CaptureAgentId

Source

pub fn set_keep_alive_timer(&mut self, keep_alive_timer: u16) -> &mut Chunk

set Chunk types of KeepAliveTimer

Source

pub fn set_authenticate_key(&mut self, authenticate_key: String) -> &mut Chunk

set Chunk types of AuthenticateKey

Source

pub fn set_packet_payload(&mut self, packet_payload: String) -> &mut Chunk

set Chunk types of PacketPayload

Valid Data in PacketPayload

Source

pub fn set_compressed_payload( &mut self, compressed_payload: String, ) -> &mut Chunk

set Chunk types of CompressedPayload

Source

pub fn set_set_internal_correlation_id( &mut self, internal_correlation_id: String, ) -> &mut Chunk

set Chunk types of InternalCorrelationId

Source

pub fn set_vlan_id(&mut self, vlan_id: u16) -> &mut Chunk

set Chunk types of VlanId

Source

pub fn set_group_id(&mut self, group_id: String) -> &mut Chunk

set Chunk types of GroupId

Source

pub fn set_src_mac(&mut self, src_mac: u64) -> &mut Chunk

set Chunk types of SrcMac

Source

pub fn set_dst_mac(&mut self, dst_mac: u64) -> &mut Chunk

set Chunk types of DstMac

Source

pub fn set_ethernet_type(&mut self, ethernet_type: u16) -> &mut Chunk

set Chunk types of EthernetType

Source

pub fn set_tcp_flag(&mut self, tcp_flag: u8) -> &mut Chunk

set Chunk types of TcpFlag

Source

pub fn set_ip_tos(&mut self, ip_tos: u8) -> &mut Chunk

set Chunk types of IpTos

Source

pub fn set_mos_value(&mut self, mos_value: u16) -> &mut Chunk

set Chunk types of MosValue

Source

pub fn set_rfactor(&mut self, rfactor: u16) -> &mut Chunk

set Chunk types of RFactor

Source

pub fn set_geo_location(&mut self, geo_location: String) -> &mut Chunk

set Chunk types of GeoLocation

Source

pub fn set_jitter(&mut self, jitter: u32) -> &mut Chunk

set Chunk types of Jitter

Source

pub fn set_translation_type(&mut self, translation_type: String) -> &mut Chunk

set Chunk types of TranslationType

Source

pub fn set_payload_json_keys(&mut self, payload_json_keys: String) -> &mut Chunk

set Chunk types of PlayloadJsonKeys

Source

pub fn set_tags_values(&mut self, tags_values: String) -> &mut Chunk

set Chunk types of TagsValues

Source

pub fn set_type_of_tag(&mut self, type_of_tag: String) -> &mut Chunk

set Chunk types of TypeOfTag

Trait Implementations§

Source§

impl Clone for Chunk

Source§

fn clone(&self) -> Chunk

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Chunk

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Chunk

Source§

fn eq(&self, other: &Chunk) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Chunk

Auto Trait Implementations§

§

impl Freeze for Chunk

§

impl RefUnwindSafe for Chunk

§

impl Send for Chunk

§

impl Sync for Chunk

§

impl Unpin for Chunk

§

impl UnwindSafe for Chunk

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.