They will be returned as a perl array.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
OUTPUT:
RETVAL
+void
+get_sets(session)
+ struct ipset_session *session;
+
+ PREINIT:
+ enum ipset_envopt envopt = IPSET_ENV_LIST_SETNAME;
+
+ char* sets = NULL;
+ char* p = NULL;
+
+ PPCODE:
+ sets = call_list_cmd(session, envopt, NULL);
+
+ char* set = strtok_r(sets, "\n", &p);
+
+ while (set) {
+ // Push the set to the perl array.
+ XPUSHs(sv_2mortal(newSVpv(set, strlen(set))));
+
+ // Move on to next set
+ set = strtok_r(NULL, "\n", &p);
+ }
+
+ if(sets) {
+ free(sets);
+ }
SV*
get_error_message(session)