@@ -35,8 +35,8 @@ type EthernetFrame struct {
3535 SrcMAC net.HardwareAddr // MAC address of the source device.
3636 EtherType * EthernetType // The protocol of the upper layer.
3737 Payload []byte
38- dstVendor string
39- srcVendor string
38+ DstVendor string
39+ SrcVendor string
4040}
4141
4242func NewEthernetFrame (dstMAC , srcMAC net.HardwareAddr , et EtherType , payload []byte ) (* EthernetFrame , error ) {
@@ -48,8 +48,8 @@ func NewEthernetFrame(dstMAC, srcMAC net.HardwareAddr, et EtherType, payload []b
4848 SrcMAC : srcMAC ,
4949 EtherType : & EthernetType {Val : et , Desc : ethertypedesc (et )},
5050 Payload : payload ,
51- dstVendor : oui .VendorWithMAC (dstMAC ),
52- srcVendor : oui .VendorWithMAC (srcMAC ),
51+ DstVendor : oui .VendorWithMAC (dstMAC ),
52+ SrcVendor : oui .VendorWithMAC (srcMAC ),
5353 }, nil
5454}
5555
@@ -62,16 +62,16 @@ func (ef *EthernetFrame) String() string {
6262%s` ,
6363 ef .Summary (),
6464 ef .DstMAC ,
65- ef .dstVendor ,
65+ ef .DstVendor ,
6666 ef .SrcMAC ,
67- ef .srcVendor ,
67+ ef .SrcVendor ,
6868 ef .EtherType ,
6969 len (ef .Payload ),
7070 hex .Dump (ef .ToBytes ()))
7171}
7272
7373func (ef * EthernetFrame ) Summary () string {
74- return fmt .Sprintf ("Ethernet Frame: Src MAC: %s → Dst MAC: %s" , ef .srcVendor , ef .dstVendor )
74+ return fmt .Sprintf ("Ethernet Frame: Src MAC: %s → Dst MAC: %s" , ef .SrcVendor , ef .DstVendor )
7575}
7676
7777func (ef * EthernetFrame ) MarshalBinary () ([]byte , error ) {
@@ -98,8 +98,8 @@ func (ef *EthernetFrame) UnmarshalBinary(data []byte) error {
9898 etdesc := ethertypedesc (et )
9999 ef .EtherType = & EthernetType {Val : et , Desc : etdesc }
100100 ef .Payload = data [headerSizeEthernet :]
101- ef .dstVendor = oui .VendorWithMAC (ef .DstMAC )
102- ef .srcVendor = oui .VendorWithMAC (ef .SrcMAC )
101+ ef .DstVendor = oui .VendorWithMAC (ef .DstMAC )
102+ ef .SrcVendor = oui .VendorWithMAC (ef .SrcMAC )
103103 return nil
104104}
105105
0 commit comments