nps: poci/nws_poci.c - next step in sanitizing this software - rem...

baggins baggins at pld-linux.org
Mon Sep 12 20:30:09 CEST 2005


Author: baggins                      Date: Mon Sep 12 18:30:09 2005 GMT
Module: nps                           Tag: HEAD
---- Log message:
- next step in sanitizing this software - remove system(3) usage

---- Files affected:
nps/poci:
   nws_poci.c (1.8 -> 1.9) 

---- Diffs:

================================================================
Index: nps/poci/nws_poci.c
diff -u nps/poci/nws_poci.c:1.8 nps/poci/nws_poci.c:1.9
--- nps/poci/nws_poci.c:1.8	Mon Sep 12 18:32:12 2005
+++ nps/poci/nws_poci.c	Mon Sep 12 20:30:04 2005
@@ -75,6 +75,10 @@
 #define SP_IP_CONFIG		"/etc/newisys/ip_sp"
 #endif
 
+#define	IP_A_SHOW	1
+#define	IP_A_ADD	2
+#define	IP_A_FLUSH	3
+
 /**********************************************
 Function:   main
 Arguments:  none
@@ -392,6 +396,28 @@
     strncat(outBuf, "</error> ", AVAIL(outBuf));
 
     return;
+}
+
+int call_iproute2(int command, char *iface, char *pl_ip, char *sp_ip, int prefix, char *logfile)
+{
+	switch (command) {
+		case IP_A_SHOW:
+		// /sbin/ip address show %s 2>%s
+			break;
+		case IP_A_FLUSH:
+		// /sbin/ip address flush jnet0
+			break;
+		case IP_A_ADD:
+		// /sbin/ip address add %s peer %s dev jnet0
+		// /sbin/ip address add %s peer %s dev jnet0
+		// /sbin/ip address add %s dev %s 2>%s
+		// /sbin/ip address add %s/%d dev %s 2>%s
+		// /sbin/ip address add %s/%d dev %s 2>%s
+			break;
+		default:
+			return -1;
+	}
+	return 0;
 }
 
 /*
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/nps/poci/nws_poci.c?r1=1.8&r2=1.9&f=u




More information about the pld-cvs-commit mailing list