|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.nio.JMemory
org.jnetpcap.nio.JBuffer
org.jnetpcap.packet.JHeader
org.jnetpcap.protocol.lan.SLL
@Header(length=16,
suite=LAN,
description="Linux Cooked Capture")
public class SLLFor captures on Linux cooked sockets, we construct a fake header that includes: a 2-byte "packet type" which is one of: LINUX_SLL_HOST packet was sent to us LINUX_SLL_BROADCAST packet was broadcast LINUX_SLL_MULTICAST packet was multicast LINUX_SLL_OTHERHOST packet was sent to somebody else LINUX_SLL_OUTGOING packet was sent *by* us; a 2-byte Ethernet protocol field; a 2-byte link-layer type; a 2-byte link-layer address length; an 8-byte source link-layer address, whose actual length is specified by the previous value. All fields except for the link-layer address are in network byte order. DO NOT change the layout of this structure, or change any of the LINUX_SLL_ values below. If you must change the link-layer header for a "cooked" Linux capture, introduce a new DLT_ type (ask "tcpdump-workers@lists.tcpdump.org" for one, so that you don't give it a value that collides with a value already being used), and use the new header in captures of that type, so that programs that can handle DLT_LINUX_SLL captures will continue to handle them correctly without any change, and so that capture files with different headers can be told apart and programs that read them can dissect the packets in them.
#define SLL_HDR_LEN 16 // total header length
#define SLL_ADDRLEN 8 // length of address field
struct sll_header {
u_int16_t sll_pkttype; // packet type
u_int16_t sll_hatype; // link-layer address type
u_int16_t sll_halen; // link-layer address length
u_int8_t sll_addr[SLL_ADDRLEN]; // link-layer address
u_int16_t sll_protocol; // protocol
};
| Nested Class Summary | |
|---|---|
static class |
SLL.HardwareAddressType
The Enum HardwareAddressType. |
| Nested classes/interfaces inherited from class org.jnetpcap.packet.JHeader |
|---|
JHeader.State |
| Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory |
|---|
JMemory.Type |
| Field Summary | |
|---|---|
static int |
ID
Constant numerial ID for this protocol's header. |
static int |
LINUX_SLL_BROADCAST
The Constant LINUX_SLL_BROADCAST. |
static int |
LINUX_SLL_HOST
The Constant LINUX_SLL_HOST. |
static int |
LINUX_SLL_MULTICAST
The Constant LINUX_SLL_MULTICAST. |
static int |
LINUX_SLL_OTHERHOST
The Constant LINUX_SLL_OTHERHOST. |
static int |
LINUX_SLL_OUTGOING
The Constant LINUX_SLL_OUTGOING. |
static int |
SLL_HDR_LEN
The Constant SLL_HDR_LEN. |
| Fields inherited from class org.jnetpcap.packet.JHeader |
|---|
annotatedHeader, BYTE, EMPTY_HEADER_ARRAY, isSubHeader, packet, state |
| Fields inherited from class org.jnetpcap.nio.JMemory |
|---|
JNETPCAP_LIBRARY_NAME, MAX_DIRECT_MEMORY_DEFAULT, POINTER |
| Constructor Summary | |
|---|---|
SLL()
|
|
| Method Summary | |
|---|---|
byte[] |
address()
Link layer address. |
int |
addressLength()
Link Layer address length. |
int |
haLength()
Link Layer address length. |
int |
haType()
Link Layer address type. |
SLL.HardwareAddressType |
haTypeEnum()
Ha type enum. |
int |
packetType()
Packet type. |
int |
type()
next protocol. |
Ethernet.EthernetType |
typeEnum()
Next protocol as an EtherType constant. |
| Methods inherited from class org.jnetpcap.nio.JBuffer |
|---|
findUTF8String, getByte, getByteArray, getByteArray, getByteArray, getDouble, getFloat, getInt, getLong, getShort, getUByte, getUInt, getUShort, getUTF8Char, getUTF8String, getUTF8String, getUTF8String, getUTF8String, isReadonly, order, order, peer, peer, peer, peer, setByte, setByteArray, setByteBuffer, setDouble, setFloat, setInt, setLong, setShort, setShort0, setUByte, setUInt, setUShort, transferFrom, transferFrom, transferFrom, transferTo, transferTo, transferTo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SLL_HDR_LEN
public static final int LINUX_SLL_HOST
public static final int LINUX_SLL_BROADCAST
public static final int LINUX_SLL_MULTICAST
public static final int LINUX_SLL_OTHERHOST
public static final int LINUX_SLL_OUTGOING
public static int ID
| Constructor Detail |
|---|
public SLL()
| Method Detail |
|---|
@Field(offset=0,
length=16)
public int packetType()
@Field(offset=16,
length=16)
public int haType()
public SLL.HardwareAddressType haTypeEnum()
@Field(offset=32,
length=16)
public int haLength()
@Dynamic(value=LENGTH) public int addressLength()
@Field(offset=48,
format="#mac#")
public byte[] address()
@Field(offset=112,
length=16,
format="%x")
public int type()
public Ethernet.EthernetType typeEnum()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||