pub struct Mack<'a, V> { /* private fields */ }
Expand description

MACK message.

The MACK message, as defined in Figure 8 of the OSNMA ICD.

This is one of the few structs in bitfields that is not a simple wrapper around a slice. The reason is that to interpret the MACK message, it is necessary to know the key and tag sizes, so Mack holds these values as well.

The V type parameter is used to indicate the validation status of the MACK message. Validation of a MACK message corresponds to checking its MACSEQ field and that its ADKDs match the corresponding look-up table. See validation for a description of validation type parameters.

Implementations

Constructs a new MACK message.

The data should be a reference to an array containing the 60 bytes of the MACK message. The key_size in bits and tag_size in bits should be taken from the parameters of the current TESLA chain. The MACK message is marked as NotValidated.

Gives the key size in bits corresponding to the MACK message.

This returns the value that has been given in Mack::new.

Gives the key size in bits corresponding to the MACK message.

This returns the value that has been given in Mack::new.

Gives the tag0 field contained in the MACK header of the MACK message.

See Figure 9 in the OSNMA ICD.

Gives the value of the MACSEQ field contained in the MACK header of the MACK message.

See Figure 9 in the OSNMA ICD. The MACSEQ is a 12-bit integer, which is returned as a u16.

Returns the number of tags in the MACK message.

The number of tags is computed according to the tag size.

Gives the Key field of the MACK message.

This fields contains a TESLA key. See Figure 8 in the OSNMA ICD.

Gives an object representing one of the Tag-Info sections in the MACK message.

The Tag-Info section is defined in Figure 11 of the OSNMA ICD. The parameter n corresponds to the index of the Tag-Info in the MACK message. The first Tag-Info has n = 1, since n = 0 would correspond to the Tag0 field, which does not have an associated info field and is obtained with Mack::tag0.

The validation status of the Tag-Info is inherited from the validation status of the MACK message. There is no way to validate Tag-Info sections once they have been separated from the MACK message. If a validated Tag-Info is needed, the whole MACK message should be validated first using Mack::validate before calling Mack::tag_and_info.

Panics

Panics if n is not between 1 and self.num_tags() - 1.

Try to validate the MACK message.

Given the TESLA key transmitted on the next subframe, this will attempt to validate the MACSEQ field and the ADKD fields of the MACK message. The MACSEQ field is checked using the algorithm in Section 6.6 of the OSNMA ICD. The sequence of ADKD fields is checked against the MAC look-up table using the chain parameters held by the TESLA key.

The parameter prna should be the SVN of the satellite that transmitted this MACK message, and gst_mack corresponds to the GST at the start of the subframe in which the MACK message was transmitted.

If the validation is successful, this returns a copy of self with the validation type parameter V set to Validated. Otherwise, an error indicating which check was not satisfied is returned.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

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

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

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.