34 #ifndef PTLIB_ETHSOCKET_H 35 #define PTLIB_ETHSOCKET_H 44 class PWin32PacketDriver;
45 class PWin32SnmpLibrary;
46 class PWin32PacketBuffer;
48 PARRAY(PWin32PackBufArray, PWin32PacketBuffer);
65 PINDEX nReadBuffers = 8,
66 PINDEX nWriteBuffers = 1,
201 unsigned queueSize = 5,
396 #include "msos/ptlib/ethsock.h" 398 #include "unix/ptlib/ethsock.h" 403 #endif // PTLIB_ETHSOCKET_H Packets directed at the interface.
Definition: ethsock.h:317
BYTE b[6]
Definition: ethsock.h:80
BYTE ctrl
Definition: ethsock.h:119
Packets with a broadcast address.
Definition: ethsock.h:323
WORD s
Definition: ethsock.h:84
BYTE ssap
Definition: ethsock.h:118
~PEthSocket()
Close the socket.
Appletalk DDP.
Definition: ethsock.h:305
struct PEthSocket::Address::@0 ls
virtual PBoolean OpenSocket()
MediumTypes GetMedium()
Return the type of the interface.
WORD w[3]
Definition: ethsock.h:81
MediumTypes
Medium types for the open interface.
Definition: ethsock.h:272
Multicast packets directed at the interface.
Definition: ethsock.h:319
friend ostream & operator<<(ostream &s, const Address &a)
Definition: ethsock.h:101
WORD length
Definition: ethsock.h:116
PBoolean GetFilter(unsigned &mask, WORD &type)
Get the current filtering criteria for receiving packets.
An ethernet MAC Address specification.
Definition: ethsock.h:79
PBoolean SetFilter(unsigned mask, WORD type=TypeAll)
Set the current filtering criteria for receiving packets.
PBoolean ReadPacket(PBYTEArray &buffer, Address &dest, Address &src, WORD &type, PINDEX &len, BYTE *&payload)
Read a packet from the interface and parse out the information specified by the parameters.
virtual PBoolean Close()
Close the channel, shutting down the link to the data source.
PBoolean ResetAdaptor()
Reset the interface.
WORD port
Port to be used by the socket when opening the channel.
Definition: socket.h:444
A Wide Area Network (modem etc)
Definition: ethsock.h:278
X.25.
Definition: ethsock.h:301
FilterMask
Mask filter bits for GetFilter() function.
Definition: ethsock.h:315
BOOL PBoolean
Definition: object.h:102
bool operator==(const BYTE *eth) const
All frames (3 is value for Linux)
Definition: ethsock.h:297
virtual const char * GetProtocolName() const
This function returns the protocol name for the socket type.
Bluebook IPv6.
Definition: ethsock.h:311
Array of unsigned characters.
Definition: array.h:670
An ethernet Network Interface Card (10base2, 10baseT etc)
Definition: ethsock.h:276
Address Resolution Protocol.
Definition: ethsock.h:303
bool operator!=(const Address ð) const
Definition: ethsock.h:97
Something else.
Definition: ethsock.h:280
#define PARRAY(cls, T)
Declare an array to a specific type of object.
Definition: array.h:1084
The character string class.
Definition: pstring.h:108
PBoolean GetAddress(Address &addr)
Get the low level MAC address of the open interface.
EthTypes
Type codes for ethernet frames.
Definition: ethsock.h:295
Internet Protocol.
Definition: ethsock.h:299
bool operator!=(const BYTE *eth) const
PBoolean GetIpAddress(PIPSocket::Address &addr)
Get the prime IP number bound to the open interface.
Address src_addr
Definition: ethsock.h:109
Definition: ethsock.h:281
WORD type
Definition: ethsock.h:112
WORD filterType
Definition: ethsock.h:391
An ethernet MAC frame.
Definition: ethsock.h:107
Appletalk AARP.
Definition: ethsock.h:307
PEthSocket(PINDEX nReadBuffers=8, PINDEX nWriteBuffers=1, PINDEX size=1514)
Create a new ethernet packet socket.
virtual PBoolean Connect(const PString &address)
Connect a socket to an interface.
virtual PBoolean Write(const void *buf, PINDEX len)
Low level write to the channel.
A class describing an IP address.
Definition: ipsock.h:75
DWORD l
Definition: ethsock.h:83
PBoolean EnumIpAddress(PINDEX idx, PIPSocket::Address &addr, PIPSocket::Address &netMask)
Enumerate all of the IP addresses and net masks bound to the open interface.
Address dst_addr
Definition: ethsock.h:108
bool operator==(const Address ð) const
Definition: ethsock.h:96
A network communications channel.
Definition: socket.h:58
All multicast packets.
Definition: ethsock.h:321
PBoolean EnumInterfaces(PINDEX idx, PString &name)
Enumerate all the interfaces that are capable of being accessed at the ethernet level.
All packets.
Definition: ethsock.h:325
virtual PBoolean Read(void *buf, PINDEX len)
Low level read from the channel.
virtual PBoolean Listen(unsigned queueSize=5, WORD port=0, Reusability reuse=AddressIsExclusive)
This function is illegal and will assert if attempted.
Reusability
Flags to reuse of port numbers in Listen() function.
Definition: socket.h:84
Novell IPX.
Definition: ethsock.h:309
This class describes a type of socket that will communicate using raw ethernet packets.
Definition: ethsock.h:54
BYTE dsap
Definition: ethsock.h:117
A Loopback Network.
Definition: ethsock.h:274
Address & operator=(const Address &addr)