Browse Source

* source/portknock : implement stop() & destroy()

master
Alex 'AdUser' Z 8 years ago
parent
commit
a626b8e164
  1. 10
      src/sources/portknock.c

10
src/sources/portknock.c

@ -176,7 +176,9 @@ bool
stop(cfg_t *cfg) {
assert(cfg != NULL);
/* TODO */
for (f2b_port_t *port = cfg->ports; port != NULL; port = port->next)
close(port->sock);
return true;
}
@ -192,7 +194,13 @@ next(cfg_t *cfg, char *buf, size_t bufsize, bool reset) {
void
destroy(cfg_t *cfg) {
f2b_port_t *next;
assert(cfg != NULL);
for (; cfg->ports != NULL; cfg->ports = next) {
next = cfg->ports->next;
free(cfg->ports);
}
free(cfg);
}

Loading…
Cancel
Save