net: Refactor to protect access to the NetState variable

Changes to NetState now go through an accessor function called
net_set_state()

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
diff --git a/net/cdp.c b/net/cdp.c
index 3dab6a1..fa92409 100644
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -235,7 +235,7 @@
 	if (!CDPOK)
 		NetStartAgain();
 	else
-		NetState = NETLOOP_SUCCESS;
+		net_set_state(NETLOOP_SUCCESS);
 }
 
 static void