This class describes a type of socket that will communicate using raw ethernet packets
![]() | Address An ethernet MAC Address specification |
![]() | Frame An ethernet MAC frame |
![]() | Constructor |
![]() | Overrides from class PChannel |
![]() | Overrides from class PSocket |
![]() | Information functions |
![]() | Filtering functions |
![]() | I/O functions |
Socket establishment functions
Socket options functions
Port/Service database functions
Multiple socket selection functions
Integer conversion functions
Construction
Overrides from class PObject
Reading functions
Writing functions
Miscellaneous functions
Error functions
Run Time Type functions
Comparison functions
This class describes a type of socket that will communicate using raw ethernet packets
The GetErrorCode() function should be consulted after Read() returns
FALSE to determine what caused the failure.
The GetErrorCode() function should be consulted after Write() returns
FALSE to determine what caused the failure.
Note that the driver does not need to be open for this function to work.
A bit-wise OR of the FilterMask values will filter packets so that
they do not appear in the Read() function at all. The type is be the specific frame type to accept. A value of TypeAll
may be used to match all frame types.
The type is be the specific frame type to accept. A value of TypeAll
may be used to match all frame types. A value of zero for the filter mask is useless and will assert.
struct Frame
void Parse( WORD & type, BYTE * & payload, PINDEX & length )
Overrides from class PChannel
virtual BOOL Close()
virtual BOOL Read( void * buf, PINDEX len )
len - Maximum number of bytes to read into the buffer.virtual BOOL Write( const void * buf, PINDEX len )
len - Number of bytes to write. Overrides from class PSocket
virtual BOOL Connect( const PString & address )
virtual BOOL Listen( unsigned queueSize = 5, WORD port = 0, Reusability reuse = AddressIsExclusive )
port - Port number to use for the connection.
reuse - Can/Cant listen more than once. Information functions
BOOL EnumInterfaces( PINDEX idx, PString & name )
name - Interface nameBOOL GetAddress( Address & addr )
BOOL GetIpAddress( PIPSocket::Address & addr )
BOOL GetIpAddress( PIPSocket::Address & addr, PIPSocket::Address & netMask )
netMask - Variable to receive the net mask.BOOL EnumIpAddress( PINDEX idx, PIPSocket::Address & addr, PIPSocket::Address & netMask )
addr - Variable to receive the IP address.
netMask - Variable to receive the net mask.enum MediumTypes
MediumLoop
Medium802_3
MediumTypes GetMedium()
Filtering functions
enum EthTypes
TypeAll
TypeIP
TypeX25
TypeARP
enum FilterMask
FilterDirected
FilterMulticast
FilterAllMulticast
BOOL GetFilter( unsigned & mask, WORD & type )
type - Code for filtering on type.BOOL SetFilter( unsigned mask, WORD type = TypeAll )
type - Code for filtering on type. I/O functions
BOOL ResetAdaptor()
BOOL ReadPacket( PBYTEArray & buffer, Address & dest, Address & src, WORD & type, PINDEX & len, BYTE * & payload )
dest - Destination address of packet
src - Source address of packet
type - Packet frame type ID
len - Length of payload
payload - Pointer into buffer of payload.
Alphabetic index HTML hierarchy of classes or Java