blob: 7d191d7d9f7d526fb48485b0ca6012667173b84f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
use crate::{Deserialize, Result, Serialize};
use std::io::{Read, Write};
use bitfield::bitfield;
bitfield! {
/// Version and type of a PPPoE header combined in a single octet.
#[derive(Clone, Eq, PartialEq)]
pub struct VerType(u8);
impl Debug;
u8;
pub ver, set_ver: 7, 4;
pub ty, set_ty: 3, 0;
}
impl Default for VerType {
fn default() -> Self {
Self(0x11)
}
}
impl Serialize for VerType {
fn serialize<W: Write>(&self, w: &mut W) -> Result<()> {
self.0.serialize(w)
}
}
impl Deserialize for VerType {
fn deserialize<R: Read>(&mut self, r: &mut R) -> Result<()> {
self.0.deserialize(r)
}
}
|