Mailing List Archive

libnasl/nasl nasl_host.c,1.3,1.4 nasl_host.h,1.3,1.4 nasl_init.c,1.6,1.7
Update of /usr/local/cvs/libnasl/nasl
In directory raccoon.nessus.org:/tmp/cvs-serv83158

Modified Files:
nasl_host.c nasl_host.h nasl_init.c
Log Message:
o Added function islocalnet() (returns TRUE if the remote host is on the
local subnet)


Index: nasl_host.c
===================================================================
RCS file: /usr/local/cvs/libnasl/nasl/nasl_host.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- nasl_host.c 13 Jan 2003 13:05:08 -0000 1.3
+++ nasl_host.c 14 Jan 2003 20:44:42 -0000 1.4

@@ -133,6 +133,20 @@
return retc;
}

+
+tree_cell * nasl_islocalnet(lex_ctxt * lexic)
+{
+ struct arglist * script_infos = lexic->script_infos;
+ struct in_addr * ip = plug_get_host_ip(script_infos);
+ tree_cell * retc;
+
<a href="0005.html#0007qlink1">+ retc = alloc_tree_cell(0, NULL);

+ retc->type = CONST_INT;
+ retc->x.i_val = is_local_ip(*ip);
+ return retc;
+}
+
+
tree_cell * nasl_this_host(lex_ctxt * lexic)
{
struct arglist * script_infos = lexic->script_infos;

Index: nasl_host.h
===================================================================
RCS file: /usr/local/cvs/libnasl/nasl/nasl_host.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- nasl_host.h 13 Jan 2003 13:05:08 -0000 1.3
+++ nasl_host.h 14 Jan 2003 20:44:42 -0000 1.4

@@ -6,6 +6,7 @@
tree_cell * get_port_state(lex_ctxt * );
tree_cell * get_udp_port_state(lex_ctxt * );
tree_cell * nasl_islocalhost(lex_ctxt * );
+tree_cell * nasl_islocalnet(lex_ctxt * );

tree_cell * nasl_this_host(lex_ctxt *);
tree_cell * nasl_this_host_name(lex_ctxt *);
tree_cell * get_port_transport(lex_ctxt * );

Index: nasl_init.c
===================================================================
RCS file: /usr/local/cvs/libnasl/nasl/nasl_init.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- nasl_init.c 14 Jan 2003 18:49:44 -0000 1.6
<a href="0005.html#0007qlink2">+++ nasl_init.c 14 Jan 2003 20:44:42 -0000 1.7

@@ -119,6 +119,7 @@
"scanner_status", nasl_scanner_status, 0, {"current", "total", NULL },
"scanner_get_port", nasl_scanner_get_port, 1, { NULL },
"islocalhost", nasl_islocalhost, 0, { NULL },
+ "islocalnet", nasl_islocalnet, 0, { NULL },

"get_port_transport", get_port_transport, 1, { NULL },