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/script_i.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/script_i.hh')
-rw-r--r-- | hscript/script_i.hh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/hscript/script_i.hh b/hscript/script_i.hh index abe56ec..b82b807 100644 --- a/hscript/script_i.hh +++ b/hscript/script_i.hh @@ -72,6 +72,8 @@ struct Script::ScriptPrivate { std::vector< std::unique_ptr<Nameserver> > nses; /*! Wireless networking configuration */ std::vector< std::unique_ptr<NetSSID> > ssids; + /*! PPPoE configuration */ + std::vector< std::unique_ptr<PPPoE> > pppoes; /*! APK repositories */ std::vector< std::unique_ptr<Repository> > repos; @@ -153,6 +155,21 @@ struct Script::ScriptPrivate { return true; } + bool store_pppoe(Key *obj, const ScriptLocation &pos, int *errors, + int *, const ScriptOptions &) { + PPPoE *ppp = dynamic_cast<PPPoE *>(obj); + for(const auto &ppplink : pppoes) { + if(ppplink->iface() == ppp->iface()) { + DUPLICATE_ERROR(ppplink, "pppoe", ppplink->iface()); + return false; + } + } + + std::unique_ptr<PPPoE> uppp(ppp); + pppoes.push_back(std::move(uppp)); + return true; + } + bool store_hostname(Key* obj, const ScriptLocation &pos, int *errors, int *, const ScriptOptions &) { if(hostname) { |