Struct Server

Source
pub struct Server { /* private fields */ }
Expand description

A Server is defined as the responder in a network connection for events regarding sessions, connections, or bidirectional flow records.

For TCP events, the server is the receiver of the initial SYN packet(s) of the TCP connection. For other protocols, the server is generally the responder in the network transaction. Some systems actually use the term “responder” to refer the server in TCP connections. The server fields describe details about the system acting as the server in the network event. Server fields are usually populated in conjunction with client fields. Server fields are generally not populated for packet-level events.

Client / server representations can add semantic context to an exchange, which is helpful to visualize the data in certain situations. If your context falls in that category, you should still ensure that source and destination are filled appropriately.

Implementations§

Source§

impl Server

Source

pub fn get_address(&self) -> Option<&String>

Some event server addresses are defined ambiguously. The event will sometimes list an IP, a domain or a unix socket. You should always store the raw address in the .address field.

Then it should be duplicated to .ip or .domain, depending on which one it is.

Source

pub fn set_address(&mut self, address_arg: String)

Some event server addresses are defined ambiguously. The event will sometimes list an IP, a domain or a unix socket. You should always store the raw address in the .address field.

Then it should be duplicated to .ip or .domain, depending on which one it is.

Source

pub fn get_ip(&self) -> Option<&String>

IP address of the server (IPv4 or IPv6).

Source

pub fn set_ip(&mut self, ip_arg: String)

IP address of the server (IPv4 or IPv6).

Source

pub fn get_port(&self) -> Option<&u64>

Port of the server.

Source

pub fn set_port(&mut self, port_arg: u64)

Port of the server.

Source

pub fn get_mac(&self) -> Option<&String>

MAC address of the server.

The notation format from RFC 7042 is suggested: Each octet (that is, 8-bit byte) is represented by two [uppercase] hexadecimal digits giving the value of the octet as an unsigned integer. Successive octets are separated by a hyphen.

Source

pub fn set_mac(&mut self, mac_arg: String)

MAC address of the server.

The notation format from RFC 7042 is suggested: Each octet (that is, 8-bit byte) is represented by two [uppercase] hexadecimal digits giving the value of the octet as an unsigned integer. Successive octets are separated by a hyphen.

§Example

00-00-5E-00-53-23

Source

pub fn get_domain(&self) -> Option<&String>

The domain name of the server system.

This value may be a host name, a fully qualified domain name, or another host naming format. The value may derive from the original event or be added from enrichment.

Source

pub fn set_domain(&mut self, domain_arg: String)

The domain name of the server system.

This value may be a host name, a fully qualified domain name, or another host naming format. The value may derive from the original event or be added from enrichment.

§Example

foo.example.com

Source

pub fn get_registered_domain(&self) -> Option<&String>

The highest registered server domain, stripped of the subdomain.

For example, the registered domain for “foo.example.com” is “example.com”.

This value can be determined precisely with a list like the public suffix list (http://publicsuffix.org). Trying to approximate this by simply taking the last two labels will not work well for TLDs such as “co.uk”.

Source

pub fn set_registered_domain(&mut self, registered_domain_arg: String)

The highest registered server domain, stripped of the subdomain.

For example, the registered domain for “foo.example.com” is “example.com”.

This value can be determined precisely with a list like the public suffix list (http://publicsuffix.org). Trying to approximate this by simply taking the last two labels will not work well for TLDs such as “co.uk”.

§Example

example.com

Source

pub fn get_top_level_domain(&self) -> Option<&String>

The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is “com”.

This value can be determined precisely with a list like the public suffix list (http://publicsuffix.org). Trying to approximate this by simply taking the last label will not work well for effective TLDs such as “co.uk”.

Source

pub fn set_top_level_domain(&mut self, top_level_domain_arg: String)

The effective top level domain (eTLD), also known as the domain suffix, is the last part of the domain name. For example, the top level domain for example.com is “com”.

This value can be determined precisely with a list like the public suffix list (http://publicsuffix.org). Trying to approximate this by simply taking the last label will not work well for effective TLDs such as “co.uk”.

§Example

co.uk

Source

pub fn get_subdomain(&self) -> Option<&String>

The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.

For example the subdomain portion of “www.east.mydomain.co.uk” is “east”. If the domain has multiple levels of subdomain, such as “sub2.sub1.example.com”, the subdomain field should contain “sub2.sub1”, with no trailing period.

Source

pub fn set_subdomain(&mut self, subdomain_arg: String)

The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.

For example the subdomain portion of “www.east.mydomain.co.uk” is “east”. If the domain has multiple levels of subdomain, such as “sub2.sub1.example.com”, the subdomain field should contain “sub2.sub1”, with no trailing period.

§Example

east

Source

pub fn get_bytes(&self) -> Option<&u64>

Bytes sent from the server to the client.

Source

pub fn set_bytes(&mut self, bytes_arg: u64)

Bytes sent from the server to the client.

§Example

184

Source

pub fn get_packets(&self) -> Option<&u64>

Packets sent from the server to the client.

Source

pub fn set_packets(&mut self, packets_arg: u64)

Packets sent from the server to the client.

§Example

12

Source

pub fn get_nat_ip(&self) -> Option<&String>

Translated ip of destination based NAT sessions (e.g. internet to private DMZ)

Typically used with load balancers, firewalls, or routers.

Source

pub fn set_nat_ip(&mut self, nat_ip_arg: String)

Translated ip of destination based NAT sessions (e.g. internet to private DMZ)

Typically used with load balancers, firewalls, or routers.

Source

pub fn get_nat_port(&self) -> Option<&u64>

Translated port of destination based NAT sessions (e.g. internet to private DMZ)

Typically used with load balancers, firewalls, or routers.

Source

pub fn set_nat_port(&mut self, nat_port_arg: u64)

Translated port of destination based NAT sessions (e.g. internet to private DMZ)

Typically used with load balancers, firewalls, or routers.

Trait Implementations§

Source§

impl Clone for Server

Source§

fn clone(&self) -> Server

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

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

Performs copy-assignment from source. Read more
Source§

impl Default for Server

Source§

fn default() -> Server

Returns the “default value” for a type. Read more
Source§

impl Serialize for Server

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Server

§

impl RefUnwindSafe for Server

§

impl Send for Server

§

impl Sync for Server

§

impl Unpin for Server

§

impl UnwindSafe for Server

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.