Skip to content

Commit

Permalink
Add support for XXL product id
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Aug 22, 2024
1 parent 10fb326 commit 0561c15
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/Prefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class Prefs {
bool is_enterprise_m_edition();
bool is_enterprise_l_edition();
bool is_enterprise_xl_edition();
bool is_enterprise_xxl_edition();

bool is_edr_mode() { return false; /* TODO (used to be private Cloud mode) */ };

Expand Down
11 changes: 11 additions & 0 deletions src/LuaEngineNtop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3540,6 +3540,14 @@ static int ntop_is_enterprise_xl(lua_State *vm) {

/* ****************************************** */

static int ntop_is_enterprise_xxl(lua_State *vm) {
ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__);
lua_pushboolean(vm, ntop->getPrefs()->is_enterprise_xxl_edition());
return(ntop_lua_return_value(vm, __FUNCTION__, CONST_LUA_OK));
}

/* ****************************************** */

static int ntop_is_nedge(lua_State *vm) {
ntop->getTrace()->traceEvent(TRACE_DEBUG, "%s() called", __FUNCTION__);
lua_pushboolean(vm, ntop->getPrefs()->is_nedge_pro_edition());
Expand Down Expand Up @@ -4075,6 +4083,8 @@ static int ntop_get_info(lua_State *vm) {
ntop->getPrefs()->is_enterprise_l_edition());
lua_push_bool_table_entry(vm, "version.enterprise_xl_edition",
ntop->getPrefs()->is_enterprise_xl_edition());
lua_push_bool_table_entry(vm, "version.enterprise_xxl_edition",
ntop->getPrefs()->is_enterprise_xxl_edition());

lua_push_bool_table_entry(vm, "version.nedge_edition",
ntop->getPrefs()->is_nedge_pro_edition());
Expand Down Expand Up @@ -8000,6 +8010,7 @@ static luaL_Reg _ntop_reg[] = {
{ "isEnterpriseM", ntop_is_enterprise_m},
{ "isEnterpriseL", ntop_is_enterprise_l},
{ "isEnterpriseXL", ntop_is_enterprise_xl},
{ "isEnterpriseXXL", ntop_is_enterprise_xxl},
{ "isnEdge", ntop_is_nedge},
{ "isnEdgeEnterprise", ntop_is_nedge_enterprise},
{ "isPackage", ntop_is_package},
Expand Down
15 changes: 14 additions & 1 deletion src/Prefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2950,7 +2950,20 @@ bool Prefs::is_enterprise_l_edition() {
bool Prefs::is_enterprise_xl_edition() {
return
#ifdef NTOPNG_PRO
ntop->getPro()->has_valid_enterprise_xl_license()
ntop->getPro()->has_valid_enterprise_xl_license() ||
is_enterprise_xxl_edition() /* XXL or higher */
#else
false
#endif
;
}

/* *************************************** */

bool Prefs::is_enterprise_xxl_edition() {
return
#ifdef NTOPNG_PRO
ntop->getPro()->has_valid_enterprise_xxl_license()
#else
false
#endif
Expand Down

0 comments on commit 0561c15

Please sign in to comment.