File tree Expand file tree Collapse file tree
src/main/java/net/elytrium/pcap/layer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424import net .elytrium .pcap .layer .exception .LayerDecodeException ;
2525import net .elytrium .pcap .layer .exception .LayerEncodeException ;
2626
27- public class Ethernet implements Layer {
27+ public class Ethernet implements EthernetProtocolHeader {
2828
2929 private static final int SIZE = 14 ;
3030
@@ -83,10 +83,12 @@ public void setSrcAddress(byte[] srcAddress) {
8383 this .srcAddress = srcAddress ;
8484 }
8585
86+ @ Override
8687 public EthernetProtocol getProtocol () {
8788 return this .protocol ;
8889 }
8990
91+ @ Override
9092 public void setProtocol (EthernetProtocol protocol ) {
9193 this .protocol = protocol ;
9294 }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2022 Elytrium
3+ *
4+ * This program is free software: you can redistribute it and/or modify
5+ * it under the terms of the GNU Affero General Public License as published by
6+ * the Free Software Foundation, either version 3 of the License, or
7+ * (at your option) any later version.
8+ *
9+ * This program is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ * GNU Affero General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Affero General Public License
15+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
16+ */
17+
18+ package net .elytrium .pcap .layer ;
19+
20+ import net .elytrium .pcap .layer .data .EthernetProtocol ;
21+
22+ public interface EthernetProtocolHeader extends Layer {
23+
24+ EthernetProtocol getProtocol ();
25+
26+ void setProtocol (EthernetProtocol protocol );
27+ }
Original file line number Diff line number Diff line change 2424import net .elytrium .pcap .layer .exception .LayerDecodeException ;
2525import net .elytrium .pcap .layer .exception .LayerEncodeException ;
2626
27- public class LinuxSLL implements Layer {
27+ public class LinuxSLL implements EthernetProtocolHeader {
2828
2929 private static final int SIZE = 16 ;
3030
@@ -114,10 +114,12 @@ public void setAddress(byte[] address) {
114114 this .address = address ;
115115 }
116116
117+ @ Override
117118 public EthernetProtocol getProtocol () {
118119 return this .protocol ;
119120 }
120121
122+ @ Override
121123 public void setProtocol (EthernetProtocol protocol ) {
122124 this .protocol = protocol ;
123125 }
You can’t perform that action at this time.
0 commit comments