Changes necessary to support VPNConnector class
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 2 Aug 2005 06:51:09 +0000 (06:51 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 2 Aug 2005 06:51:09 +0000 (06:51 +0000)
.gitattributes
doc/db_format_change.txt
images/Makefile.am
images/vpnc.ico [new file with mode: 0644]
images/vpnc.png [new file with mode: 0644]
include/nxclapi.h
include/nximage.h
sql/images.in
src/libnxcl/objects.cpp

index 69f3b86..0c6f3ca 100644 (file)
@@ -117,6 +117,8 @@ images/template_group.ico -text
 images/template_group.png -text
 images/template_root.ico -text
 images/template_root.png -text
+images/vpnc.ico -text
+images/vpnc.png -text
 images/zone.ico -text
 images/zone.png -text
 include/Makefile.am -text
index 72d296c..f79c128 100644 (file)
@@ -20,3 +20,9 @@
                ip_netmask varchar(15),
                PRIMARY KEY(vpn_id,ip_addr)
        ) TABLE_TYPE;
+- New images added:
+       INSERT INTO default_images (object_class,image_id)
+               VALUES (12, IMG_VPN_CONNECTOR);
+       INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
+               VALUES (IMG_VPN_CONNECTOR,'Obj.VPNConnector','vpnc.png','<invalid_hash>',
+                       'vpnc.ico','<invalid_hash>');
index d9adfab..587f238 100644 (file)
@@ -22,6 +22,7 @@ images_DATA = \
     template_group.ico template_group.png \
     template.ico template.png \
     template_root.ico template_root.png \
+    vpnc.ico vpnc.png \
     zone.ico zone.png
 
 EXTRA_DIST=$(images_DATA)
diff --git a/images/vpnc.ico b/images/vpnc.ico
new file mode 100644 (file)
index 0000000..1d21a20
Binary files /dev/null and b/images/vpnc.ico differ
diff --git a/images/vpnc.png b/images/vpnc.png
new file mode 100644 (file)
index 0000000..51ea27c
Binary files /dev/null and b/images/vpnc.png differ
index 78c0cc8..c7b1b6e 100644 (file)
@@ -302,6 +302,7 @@ typedef void * NXC_SESSION;
 #define OBJ_UPDATE_POLLER_NODE      ((DWORD)0x004000)
 #define OBJ_UPDATE_IP_ADDR          ((DWORD)0x008000)
 #define OBJ_UPDATE_PEER_GATEWAY     ((DWORD)0x010000)
+#define OBJ_UPDATE_NETWORK_LIST     ((DWORD)0x020000)
 
 #define OBJ_UPDATE_NODE_ALL         ((DWORD)0x0041FF)
 #define OBJ_UPDATE_NETSRV_ALL       ((DWORD)0x00FEC1)
@@ -759,6 +760,10 @@ typedef struct
    TCHAR *pszResponce;
    DWORD dwIpAddr;
    DWORD dwPeerGateway;
+   DWORD dwNumLocalNets;
+   DWORD dwNumRemoteNets;
+   IP_NETWORK *pLocalNetList;
+   IP_NETWORK *pRemoteNetList;
 } NXC_OBJECT_UPDATE;
 
 
index 83a6891..0d1d5fb 100644 (file)
@@ -42,5 +42,6 @@
 #define IMG_TEMPLATE_ROOT           11
 #define IMG_NETWORK_SERVICE         12
 #define IMG_ZONE                    13
+#define IMG_VPN_CONNECTOR           14
 
 #endif
index 5cc57cc..8beeef5 100644 (file)
@@ -40,6 +40,9 @@ INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file
 INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
        VALUES (IMG_ZONE,'Obj.Zone','zone.png','<invalid_hash>',
                 'zone.ico','<invalid_hash>');
+INSERT INTO images (image_id,name,file_name_png,file_hash_png,file_name_ico,file_hash_ico)
+       VALUES (IMG_VPN_CONNECTOR,'Obj.VPNConnector','vpnc.png','<invalid_hash>',
+                'vpnc.ico','<invalid_hash>');
 
 
 /*
@@ -68,3 +71,5 @@ INSERT INTO default_images (object_class,image_id)
        VALUES (10, IMG_TEMPLATE_ROOT);
 INSERT INTO default_images (object_class,image_id)
        VALUES (11, IMG_NETWORK_SERVICE);
+INSERT INTO default_images (object_class,image_id)
+       VALUES (12, IMG_VPN_CONNECTOR);
index bbbc5fa..6246b22 100644 (file)
@@ -576,7 +576,7 @@ void LIBNXCL_EXPORTABLE NXCUnlockObjectIndex(NXC_SESSION hSession)
 DWORD LIBNXCL_EXPORTABLE NXCModifyObject(NXC_SESSION hSession, NXC_OBJECT_UPDATE *pUpdate)
 {
    CSCPMessage msg;
-   DWORD dwRqId;
+   DWORD dwRqId, i, dwId1, dwId2;
 
    dwRqId = ((NXCL_Session *)hSession)->CreateRqId();
 
@@ -616,10 +616,23 @@ DWORD LIBNXCL_EXPORTABLE NXCModifyObject(NXC_SESSION hSession, NXC_OBJECT_UPDATE
       msg.SetVariable(VID_IP_ADDRESS, pUpdate->dwIpAddr);
    if (pUpdate->dwFlags & OBJ_UPDATE_PEER_GATEWAY)
       msg.SetVariable(VID_PEER_GATEWAY, pUpdate->dwPeerGateway);
+   if (pUpdate->dwFlags & OBJ_UPDATE_NETWORK_LIST)
+   {
+      msg.SetVariable(VID_NUM_LOCAL_NETS, pUpdate->dwNumLocalNets);
+      msg.SetVariable(VID_NUM_REMOTE_NETS, pUpdate->dwNumRemoteNets);
+      for(i = 0, dwId1 = VID_VPN_NETWORK_BASE; i < pUpdate->dwNumLocalNets; i++)
+      {
+         msg.SetVariable(dwId1++, pUpdate->pLocalNetList[i].dwAddr);
+         msg.SetVariable(dwId1++, pUpdate->pLocalNetList[i].dwMask);
+      }
+      for(i = 0; i < pUpdate->dwNumRemoteNets; i++)
+      {
+         msg.SetVariable(dwId1++, pUpdate->pRemoteNetList[i].dwAddr);
+         msg.SetVariable(dwId1++, pUpdate->pRemoteNetList[i].dwMask);
+      }
+   }
    if (pUpdate->dwFlags & OBJ_UPDATE_ACL)
    {
-      DWORD i, dwId1, dwId2;
-
       msg.SetVariable(VID_ACL_SIZE, pUpdate->dwAclSize);
       msg.SetVariable(VID_INHERIT_RIGHTS, (WORD)pUpdate->bInheritRights);
       for(i = 0, dwId1 = VID_ACL_USER_BASE, dwId2 = VID_ACL_RIGHTS_BASE;