java.net
Class RawSocketImpl

java.lang.Object
  |
  +--java.net.RawSocketImpl
All Implemented Interfaces:
SocketOptions

public abstract class RawSocketImpl
extends java.lang.Object
implements SocketOptions

Abstract Icmp and raw socket implementation base class.

Since:
JDK1.2

Field Summary
protected  java.io.FileDescriptor fd
          The file descriptor object
protected  int protocol
          The protocol of the socket
 
Fields inherited from interface java.net.SocketOptions
ANEP_DISCARD, IP_MULTICAST_IF, IPV6_AUTH_NETWORK_LEVEL, IPV6_AUTH_TRANS_LEVEL, IPV6_ESP_NETWORK_LEVEL, IPV6_ESP_TRANS_LEVEL, IPV6_FLOW_LABEL, IPV6_MULTICAST_IF, IPV6_TRAFFIC_CLASS, SO_BINDADDR, SO_LINGER, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY
 
Constructor Summary
RawSocketImpl()
           
 
Method Summary
protected abstract  void bind(InetAddress laddr)
          Binds a raw socket to a local address.
protected abstract  void close()
          Close the socket.
protected abstract  void create(int protocol)
          Creates a raw socket
protected abstract  int getChecksum()
          Get the Checksum option.
protected  java.io.FileDescriptor getFileDescriptor()
          Get the raw socket file descriptor
protected  int getProtocol()
          Get the protocol value
protected abstract  void peek(InetAddress i)
          Peek at the packet to see who it is from.
protected abstract  void receive(RawPacket p)
          Receive the raw packet.
protected abstract  void send(RawPacket p)
          Sends a raw packet.
protected abstract  void setChecksum(int offset)
          Set the Checksum option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.net.SocketOptions
getOption, setOption
 

Field Detail

fd

protected java.io.FileDescriptor fd
The file descriptor object
Since:
JDK1.2

protocol

protected int protocol
The protocol of the socket
Constructor Detail

RawSocketImpl

public RawSocketImpl()
Method Detail

create

protected abstract void create(int protocol)
                        throws java.net.SocketException
Creates a raw socket
Since:
JDK1.2

bind

protected abstract void bind(InetAddress laddr)
                      throws java.net.SocketException
Binds a raw socket to a local address.
Since:
JDK1.2

send

protected abstract void send(RawPacket p)
                      throws java.io.IOException
Sends a raw packet. The packet contains the data and the destination address to send the packet to.
Parameters:
packet - to be sent.
Since:
JDK1.2

peek

protected abstract void peek(InetAddress i)
                      throws java.io.IOException
Peek at the packet to see who it is from.
Parameters:
return - the address which the packet came from.
Since:
JDK1.2

receive

protected abstract void receive(RawPacket p)
                         throws java.io.IOException
Receive the raw packet.
Parameters:
Packet - Received.
Since:
JDK1.2

close

protected abstract void close()
Close the socket.
Since:
JDK1.2

getFileDescriptor

protected java.io.FileDescriptor getFileDescriptor()
Get the raw socket file descriptor
Since:
JDK1.2

getProtocol

protected int getProtocol()
Get the protocol value

setChecksum

protected abstract void setChecksum(int offset)
                             throws java.net.SocketException
Set the Checksum option.
Parameters:
offset - to place the checksum.
Since:
JDK1.2

getChecksum

protected abstract int getChecksum()
                            throws java.net.SocketException
Get the Checksum option.
Since:
JDK1.2