org.jnetpcap.protocol.tcpip
Class Http

java.lang.Object
  extended by org.jnetpcap.nio.JMemory
      extended by org.jnetpcap.nio.JBuffer
          extended by org.jnetpcap.packet.JHeader
              extended by org.jnetpcap.packet.JMappedHeader
                  extended by org.jnetpcap.packet.AbstractMessageHeader
                      extended by org.jnetpcap.protocol.tcpip.Http
All Implemented Interfaces:
JPayloadAccessor

@Header(suite=TCP_IP)
public class Http
extends AbstractMessageHeader

Hyper Text Transfer Protocol header definition.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class Http.Chunk
          A http chunk that has been encoded during transfer as "Transfer-Encoding: chuncked".
static class Http.ContentType
          Http content type table.
static class Http.Request
          HTTP Request fields.
static class Http.Response
          HTTP Response fields.
 
Nested classes/interfaces inherited from class org.jnetpcap.packet.AbstractMessageHeader
AbstractMessageHeader.MessageType
 
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 numerical ID assigned to this protocol.
 
Fields inherited from class org.jnetpcap.packet.AbstractMessageHeader
rawHeader
 
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
Http()
           
 
Method Summary
 Http.Chunk[] chunks()
          Chunks.
 java.lang.String contentType()
          Content type.
 Http.ContentType contentTypeEnum()
          Content type enum.
protected  void decodeFirstLine(java.lang.String line)
          Decode first line.
 java.lang.String fieldValue(Http.Request field)
          Field value.
 java.lang.String fieldValue(Http.Response field)
          Field value.
 boolean hasChuncks()
          Checks for chuncks.
 boolean hasContent()
          Checks for content.
 boolean hasContentType()
          Checks for content type.
 boolean hasField(Http.Request field)
          Checks for field.
 boolean hasField(Http.Response field)
          Checks for field.
 java.lang.String header()
          Gets the raw header instead of reconstructing it.
 boolean isResponse()
          Checks if is response.
 
Methods inherited from class org.jnetpcap.packet.AbstractMessageHeader
decodeHeader, getMessageType, headerLength, setMessageType
 
Methods inherited from class org.jnetpcap.packet.JMappedHeader
addField, addField, addField, clearFields, fieldArray, fieldDescription, fieldDescription, fieldDisplay, fieldDisplay, fieldLength, fieldLength, fieldOffset, fieldOffset, fieldValue, fieldValue, fieldValue, fieldValue, hasField, hasField, map, map
 
Methods inherited from class org.jnetpcap.packet.JHeader
decode, getAnnotatedHeader, getDescription, getFields, getGap, getGapLength, getGapOffset, getHeader, getHeaderLength, getHeaderOffset, getId, getIndex, getLength, getName, getNextHeaderId, getNextHeaderOffset, getNicname, getOffset, getPacket, getParent, getPayload, getPayloadLength, getPayloadOffset, getPostfix, getPostfixLength, getPostfixOffset, getPrefix, getPrefixLength, getPrefixOffset, getPreviousHeaderId, getPreviousHeaderOffset, getState, getSubHeaders, hasDescription, hasGap, hasNextHeader, hasPayload, hasPostfix, hasPrefix, hasPreviousHeader, hasSubHeaders, isFragmented, isGapTruncated, isHeaderTruncated, isPayloadTruncated, isPostfixTruncated, isPrefixTruncated, peer, peer, peerPayloadTo, setPacket, setSubHeaders, sizeof, toString, transferPayloadTo, transferPayloadTo, transferPayloadTo, validateHeader
 
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 org.jnetpcap.nio.JMemory
availableDirectMemory, check, cleanup, createReference, isInitialized, isJMemoryBasedOwner, isOwner, maxDirectMemory, peer, reservedDirectMemory, setSize, size, softDirectMemory, toDebugString, toHexdump, toHexdump, totalActiveAllocated, totalAllocateCalls, totalAllocated, totalAllocatedSegments0To255Bytes, totalAllocatedSegments256OrAbove, totalDeAllocateCalls, totalDeAllocated, transferFrom, transferFrom, transferFromDirect, transferOwnership, transferTo, transferTo, transferTo, transferTo, transferTo, transferTo0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final int ID
Constant numerical ID assigned to this protocol.

See Also:
Constant Field Values
Constructor Detail

Http

public Http()
Method Detail

contentType

public java.lang.String contentType()
Content type.

Returns:
the string

contentTypeEnum

public Http.ContentType contentTypeEnum()
Content type enum.

Returns:
the content type

hasChuncks

public boolean hasChuncks()
Checks for chuncks.

Returns:
true, if successful

chunks

public Http.Chunk[] chunks()
Chunks.

Returns:
the chunk[]

decodeFirstLine

protected void decodeFirstLine(java.lang.String line)
Decode first line.

Specified by:
decodeFirstLine in class AbstractMessageHeader
Parameters:
line - the line
See Also:
AbstractMessageHeader.decodeFirstLine(java.lang.String)

fieldValue

public java.lang.String fieldValue(Http.Request field)
Field value.

Parameters:
field - the field
Returns:
the string

fieldValue

public java.lang.String fieldValue(Http.Response field)
Field value.

Parameters:
field - the field
Returns:
the string

hasContent

public boolean hasContent()
Checks for content.

Returns:
true, if successful

hasContentType

public boolean hasContentType()
Checks for content type.

Returns:
true, if successful

hasField

public boolean hasField(Http.Request field)
Checks for field.

Parameters:
field - the field
Returns:
true, if successful

hasField

public boolean hasField(Http.Response field)
Checks for field.

Parameters:
field - the field
Returns:
true, if successful

isResponse

public boolean isResponse()
Checks if is response.

Returns:
true, if is response

header

public java.lang.String header()
Gets the raw header instead of reconstructing it.

Returns:
original raw header