/* l2tp_peer.h */ #include "sockaddr_union.h" #include "timer.h" class l2tpd_t; class l2tp_tunnel_t; class ctrlfd_t; class dfs_object_t; class bvirt_ns_t; class l2tp_peer_t : public PacketHandler_t { public: l2tp_tunnel_t **l2tp_tunnels; l2tpd_t *l2tpd; l2tp_peer_t *next; union sockaddr_union local_sau; union sockaddr_union remote_sau; int m_udp_connect_failed; const char *m_secret; int m_secret_len; bvirt_ns_t *m_netns; const char *m_hw_dev; u8 m_hw_mac[6]; bool m_hw_valid; CTimer m_hw_timer; l2tp_peer_t(l2tpd_t *parent, union sockaddr_union *local, union sockaddr_union *remote, const char *secret = NULL, bvirt_ns_t *netns = NULL); void dump_sessions(ctrlfd_t *cfd, int verbose); int alloc_tunnel_id(l2tp_tunnel_t *tunnel, u16 local_tunnel = 0, u16 peer_tunnel = 0); void remove_tunnel_id(int id, l2tp_tunnel_t *tunnel); void handle_packet(char *buf, unsigned len, union sockaddr_union *sin); l2tp_tunnel_t *make_tunnel(void); l2tp_tunnel_t *find_next_tunnel(l2tp_tunnel_t *tunnel); l2tp_tunnel_t *find_avail_tunnel(void); void update_secret(const char *new_secret); const char *peer_ip(void); const char *local_ip(void); int dfs_restore(dfs_object_t *obj); void show_running_config(ctrlfd_t *cfd, int verbose); void update_hw_dev(const char *dev); void update_hw_arp(void); bool get_hw_info(struct l2tp_hardwire_info *info); };