diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-07-04 08:56:03 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-07-04 08:56:03 -0500 |
commit | 1d9c703a8eebcf8f328e610879c7a1799258bba3 (patch) | |
tree | 5c1a84c61e4277e931effe8c2aea25b20932936a /hscript/network.hh | |
parent | b0690189d37cb96924fd52e6647f84020ba56ef6 (diff) | |
download | horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.gz horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.bz2 horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.xz horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.zip |
hscipt: Implement parse and validation of 'pppoe' key
Diffstat (limited to 'hscript/network.hh')
-rw-r--r-- | hscript/network.hh | 25 |
1 files changed, 25 insertions, 0 deletions
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 <map> + #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<std::string, std::string> _params; + + PPPoE(const Script *_sc, const ScriptLocation &_pos, const std::string &_i, + const std::map<std::string, std::string> &_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<std::string, std::string> 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, |