Kea  2.3.4-git
pkt_filter6.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2015,2021 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef PKT_FILTER6_H
8 #define PKT_FILTER6_H
9 
10 #include <asiolink/io_address.h>
11 #include <dhcp/pkt6.h>
12 
13 namespace isc {
14 namespace dhcp {
15 
17 struct SocketInfo;
18 
20 class Iface;
21 
70 class PktFilter6 {
71 public:
72 
74  virtual ~PktFilter6() { }
75 
89  virtual SocketInfo openSocket(const Iface& iface,
90  const isc::asiolink::IOAddress& addr,
91  const uint16_t port,
92  const bool join_multicast) = 0;
93 
102  virtual Pkt6Ptr receive(const SocketInfo& socket_info) = 0;
103 
115  virtual int send(const Iface& iface, uint16_t sockfd,
116  const Pkt6Ptr& pkt) = 0;
117 
129  static bool joinMulticast(int sock, const std::string& ifname,
130  const std::string & mcast);
131 
132 };
133 
134 
136 typedef boost::shared_ptr<PktFilter6> PktFilter6Ptr;
137 
138 } // namespace isc::dhcp
139 } // namespace isc
140 
141 #endif // PKT_FILTER6_H
virtual int send(const Iface &iface, uint16_t sockfd, const Pkt6Ptr &pkt)=0
Sends DHCPv6 message through a specified interface and socket.
static bool joinMulticast(int sock, const std::string &ifname, const std::string &mcast)
Joins IPv6 multicast group on a socket.
Definition: pkt_filter6.cc:15
virtual ~PktFilter6()
Virtual Destructor.
Definition: pkt_filter6.h:74
virtual Pkt6Ptr receive(const SocketInfo &socket_info)=0
Receives DHCPv6 message on the interface.
Represents a single network interface.
Definition: iface_mgr.h:118
boost::shared_ptr< Pkt6 > Pkt6Ptr
A pointer to Pkt6 packet.
Definition: pkt6.h:28
Defines the logger used by the top-level component of kea-lfc.
boost::shared_ptr< PktFilter6 > PktFilter6Ptr
Pointer to a PktFilter object.
Definition: pkt_filter6.h:136
Abstract packet handling class for DHCPv6.
Definition: pkt_filter6.h:70
virtual SocketInfo openSocket(const Iface &iface, const isc::asiolink::IOAddress &addr, const uint16_t port, const bool join_multicast)=0
Opens a socket.
Holds information about socket.
Definition: socket_info.h:19