From 1d9c703a8eebcf8f328e610879c7a1799258bba3 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 4 Jul 2020 08:56:03 -0500 Subject: hscipt: Implement parse and validation of 'pppoe' key --- hscript/network.hh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'hscript/network.hh') diff --git a/hscript/network.hh b/hscript/network.hh index 18ffc34..2ed40ca 100644 --- a/hscript/network.hh +++ b/hscript/network.hh @@ -13,6 +13,8 @@ #ifndef __HSCRIPT_NETWORK_HH_ #define __HSCRIPT_NETWORK_HH_ +#include + #include "key.hh" #include "util/output.hh" @@ -93,6 +95,29 @@ public: bool execute() const override; }; +class PPPoE : public Key { +private: + const std::string _iface; + const std::map _params; + + PPPoE(const Script *_sc, const ScriptLocation &_pos, const std::string &_i, + const std::map &_p) : Key(_sc, _pos), + _iface(_i), _params(_p) {} +public: + static Key *parseFromData(const std::string &, const ScriptLocation &, + int*, int*, const Script *); + + /*! Retrieve the interface to which this PPPoE link is associated. */ + const std::string iface() const { return this->_iface; } + /*! Retrieve the parameters for this PPPoE link. */ + const std::map params() const { + return this->_params; + } + + bool validate() const override; + bool execute() const override; +}; + class Nameserver : public StringKey { private: Nameserver(const Script *_s, const ScriptLocation &_pos, -- cgit v1.2.3-60-g2f50