ndppd/src/proxy.h

65 lines
1.5 KiB
C
Raw Normal View History

2011-09-13 21:26:12 +02:00
// ndppd - NDP Proxy Daemon
// Copyright (C) 2011 Daniel Adolfsson <daniel.adolfsson@tuhox.com>
2011-09-13 21:26:12 +02:00
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __NDPPD_PROXY_H
#define __NDPPD_PROXY_H
#include <string>
#include <vector>
#include <map>
#include <sys/poll.h>
#include "ndppd.h"
__NDPPD_NS_BEGIN
class iface;
class rule;
class proxy
{
private:
ptr<iface> _ifa;
std::list<ptr<rule> > _rules;
std::list<ptr<session> > _sessions;
ptr<proxy> _weak_ptr;
proxy();
public:
static ptr<proxy> create(const ptr<iface>& ifa);
static ptr<proxy> open(const std::string& ifn);
void handle_solicit(const address& saddr, const address& daddr,
const address& taddr);
2011-09-14 10:53:21 +02:00
void remove_session(const ptr<session>& se);
2011-09-13 21:26:12 +02:00
ptr<rule> add_rule(const address& addr, const ptr<iface>& ifa);
ptr<rule> add_rule(const address& addr);
2011-09-16 17:06:36 +02:00
const ptr<iface>& ifa() const;
2011-09-13 21:26:12 +02:00
};
__NDPPD_NS_END
#endif // __NDPPD_PROXY_H