diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-17 00:52:38 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-17 00:52:38 -0500 |
commit | bbe669b761db4cb03fca2dbf9a7890d5a7e120af (patch) | |
tree | 580b71e39783a72c0416b65ef6714f454696e221 /hscript/network.hh | |
parent | 28c81a32aa59a9b2d39ddd7f86fb1d2677da32cc (diff) | |
download | horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.gz horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.bz2 horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.tar.xz horizon-bbe669b761db4cb03fca2dbf9a7890d5a7e120af.zip |
hscript: Add new netconfigtype key and associated tests
Not wired up to netaddress et al, but does parse properly.
Diffstat (limited to 'hscript/network.hh')
-rw-r--r-- | hscript/network.hh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/hscript/network.hh b/hscript/network.hh index ec8d2cf..415a337 100644 --- a/hscript/network.hh +++ b/hscript/network.hh @@ -29,6 +29,28 @@ public: bool execute() const override; }; +class NetConfigType : public Key { +public: + enum ConfigSystem { + Netifrc, + ENI + }; +private: + ConfigSystem _sys; + + NetConfigType(const Script *_sc, int _line, const ConfigSystem _s) : + Key(_sc, _line), _sys(_s) {} +public: + static Key *parseFromData(const std::string &, int, int*, int*, + const Script *); + + /*! Retrieve the desired network configuration system. */ + ConfigSystem type() const { return this->_sys; } + + bool validate() const override; + bool execute() const override; +}; + class NetAddress : public Key { public: /*! Determines the type of address an interface will obtain. */ |