1 # This file is part of Scapy 2 # Scapy is free software: you can redistribute it and/or modify 3 # it under the terms of the GNU General Public License as published by 4 # the Free Software Foundation, either version 2 of the License, or 5 # any later version. 6 # 7 # Scapy is distributed in the hope that it will be useful, 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # GNU General Public License for more details. 11 # 12 # You should have received a copy of the GNU General Public License 13 # along with Scapy. If not, see <http://www.gnu.org/licenses/>. 14 15 # scapy.contrib.description = EtherIP 16 # scapy.contrib.status = loads 17 18 from scapy.fields import BitField 19 from scapy.packet import Packet, bind_layers 20 from scapy.layers.inet import IP 21 from scapy.layers.l2 import Ether 22 23 class EtherIP(Packet): 24 name = "EtherIP / RFC 3378" 25 fields_desc = [ BitField("version", 3, 4), 26 BitField("reserved", 0, 12)] 27 28 bind_layers( IP, EtherIP, frag=0, proto=0x61) 29 bind_layers( EtherIP, Ether) 30 31