LinuxPacketSocketProtocol.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Socket_Protocols_Raw_LinuxPacketSocketProtocol_
18 #define HH_SENF_Socket_Protocols_Raw_LinuxPacketSocketProtocol_ 1
19 
20 // Custom includes
22 #include "MACAddress.hh"
23 
24 //#include "LinuxPacketSocketProtocol.mpp"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 
30  : public virtual SocketProtocol
31  {
32  public:
35 
36  void mcAdd(std::string const & interface, MACAddress const & address) const;
38 
44  void mcDrop(std::string const & interface, MACAddress const & address) const;
46 
48  void promisc(std::string const & interface, bool mode) const;
50 
51  unsigned rxQueueDropped() const;
53 
56  unsigned txWrongFormat() const;
58 
61  bool eof() const;
62 
63  protected:
64  void init_packetSocket(SocketType type, int protocol) const;
65  };
66 
68  : public virtual SocketProtocol
69  {
70  public:
71  unsigned available() const;
72  };
73 }
74 
75 //-/////////////////////////////////////////////////////////////////////////////////////////////////
76 //#include "LinuxPacketSocketProtocol.cci"
77 //#include "LinuxPacketSocketProtocol.ct"
78 //#include "LinuxPacketSocketProtocol.cti"
79 #endif
80 
81 
82 // Local Variables:
83 // mode: c++
84 // fill-column: 100
85 // comment-column: 40
86 // c-file-style: "senf"
87 // indent-tabs-mode: nil
88 // ispell-local-dictionary: "american"
89 // compile-command: "scons -u test"
90 // End:
MACAddress public header.
unsigned txWrongFormat() const
packets dropped by kernel due to wrong format (too large) since last call
Ethernet MAC address.
Definition: MACAddress.hh:72
u8 type
unsigned rxQueueDropped() const
packets dropped by kernel since last call
Socket Protocol base class.
virtual unsigned available() const =0
Return (maximum) number of bytes available for reading without < blocking.
void mcDrop(std::string const &interface, MACAddress const &address) const
Disable reception of a multicast group.
void init_packetSocket(SocketType type, int protocol) const
void promisc(std::string const &interface, bool mode) const
enable/disable promiscuous mode
SocketProtocol and ConcreteSocketProtocol public header.
void mcAdd(std::string const &interface, MACAddress const &address) const
Enable reception of a multicast group.
bool eof() const
Check for end-of-file condition.