/// Create a new item header.
Create a new item header.
Create a new item header .
fn new(
        svc_id: u16,
        svc_type: u16,
        haddr: &MacAddr,
        saddr: &SocketAddr) -> ServiceHeader {
        let ip_addr = saddr.ip();
        ServiceHeader {
            svc_id:     svc_id,
            svc_type:   svc_type,
            mac_addr:   haddr.octets(),
            ip_version: ip_addr.version(),
            ip_addr:    ip_addr.bytes(),
            port:       saddr.port(),
        }
    }
fn new ( svc_id : u16 , svc_type : u16 , haddr : & MacAddr , saddr : & SocketAddr ) -> ServiceHeader { let ip_addr = saddr . ip ( ) ; ServiceHeader { svc_id : svc_id , svc_type : svc_type , mac_addr : haddr . octets ( ) , ip_version : ip_addr . version ( ) , ip_addr : ip_addr . bytes ( ) , port : saddr . port ( ) , } }
Create a new item header.
Create a new item header .
svc_id
u16
svc_type
u16
haddr
&MacAddr
saddr
&SocketAddr