Skip to main content

MessageType

Enum MessageType 

Source
#[repr(u8)]
pub enum MessageType {
Show 29 variants Disconnect = 1, Ignore = 2, Unimplemented = 3, Debug = 4, ServiceRequest = 5, ServiceAccept = 6, KexInit = 20, NewKeys = 21, KexdhInit = 30, KexdhReply = 31, UserauthRequest = 50, UserauthFailure = 51, UserauthSuccess = 52, UserauthBanner = 53, UserauthPkOk = 60, GlobalRequest = 80, RequestSuccess = 81, RequestFailure = 82, ChannelOpen = 90, ChannelOpenConfirmation = 91, ChannelOpenFailure = 92, ChannelWindowAdjust = 93, ChannelData = 94, ChannelExtendedData = 95, ChannelEof = 96, ChannelClose = 97, ChannelRequest = 98, ChannelSuccess = 99, ChannelFailure = 100,
}
Expand description

SSH message types as defined in RFC 4253 Section 12.

Each message type has a unique numeric identifier used in the binary protocol.

Variants§

§

Disconnect = 1

Disconnect message - terminates the connection.

§

Ignore = 2

Ignore message - can be used for padding or keep-alive.

§

Unimplemented = 3

Unimplemented message - response to unknown message type.

§

Debug = 4

Debug message - debugging information.

§

ServiceRequest = 5

Service request - request a service (e.g., “ssh-userauth”).

§

ServiceAccept = 6

Service accept - service request accepted.

§

KexInit = 20

Key exchange init - algorithm negotiation.

§

NewKeys = 21

New keys - signals transition to new keys.

§

KexdhInit = 30

Diffie-Hellman/ECDH key exchange init (both use same message number). Used for DH group1/group14 and ECDH (Curve25519, nistp256, etc.).

§

KexdhReply = 31

Diffie-Hellman/ECDH key exchange reply (both use same message number).

§

UserauthRequest = 50

User authentication request.

§

UserauthFailure = 51

User authentication failure.

§

UserauthSuccess = 52

User authentication success.

§

UserauthBanner = 53

User authentication banner.

§

UserauthPkOk = 60

Public key OK (server accepts public key for authentication).

§

GlobalRequest = 80

Global request.

§

RequestSuccess = 81

Request success.

§

RequestFailure = 82

Request failure.

§

ChannelOpen = 90

Channel open.

§

ChannelOpenConfirmation = 91

Channel open confirmation.

§

ChannelOpenFailure = 92

Channel open failure.

§

ChannelWindowAdjust = 93

Channel window adjust.

§

ChannelData = 94

Channel data.

§

ChannelExtendedData = 95

Channel extended data (stderr).

§

ChannelEof = 96

Channel EOF.

§

ChannelClose = 97

Channel close.

§

ChannelRequest = 98

Channel request.

§

ChannelSuccess = 99

Channel success.

§

ChannelFailure = 100

Channel failure.

Implementations§

Source§

impl MessageType

Source

pub fn from_u8(byte: u8) -> Option<Self>

Converts a byte to a message type.

§Arguments
  • byte - The message type byte
§Returns

Some(MessageType) if valid, None otherwise.

§Example
use fynx_proto::ssh::message::MessageType;

assert_eq!(MessageType::from_u8(20), Some(MessageType::KexInit));
assert_eq!(MessageType::from_u8(255), None);
Source

pub fn name(&self) -> &'static str

Returns the message type name.

§Example
use fynx_proto::ssh::message::MessageType;

assert_eq!(MessageType::KexInit.name(), "SSH_MSG_KEXINIT");

Trait Implementations§

Source§

impl Clone for MessageType

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for MessageType

Source§

impl Debug for MessageType

Source§

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

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

impl Display for MessageType

Source§

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

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

impl Eq for MessageType

Source§

impl Hash for MessageType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MessageType

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MessageType

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more