From 83fc684b201714e0d65b166f130449f576a0b0c7 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 30 Dec 2013 16:31:59 -0800 Subject: [PATCH] Add a netconf-service version field to netconf. --- netconf-service/netconf.cpp | 4 ++++ node/NetworkConfig.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/netconf-service/netconf.cpp b/netconf-service/netconf.cpp index c016410bd..9f839aeef 100644 --- a/netconf-service/netconf.cpp +++ b/netconf-service/netconf.cpp @@ -69,6 +69,8 @@ #include +#include "../version.h" + #include "../node/Constants.hpp" #include "../node/Dictionary.hpp" #include "../node/Identity.hpp" @@ -446,6 +448,8 @@ int main(int argc,char **argv) // Assemble response dictionary to send to peer Dictionary netconf; + sprintf(buf,"%d.%d.%d",ZEROTIER_ONE_VERSION_MAJOR,ZEROTIER_ONE_VERSION_MINOR,ZEROTIER_ONE_VERSION_REVISION); + netconf[ZT_NETWORKCONFIG_DICT_KEY_NETCONF_SERVICE_VERSION] = buf; sprintf(buf,"%.16llx",(unsigned long long)nwid); netconf[ZT_NETWORKCONFIG_DICT_KEY_NETWORK_ID] = buf; netconf[ZT_NETWORKCONFIG_DICT_KEY_ISSUED_TO] = peerIdentity.address().toString(); diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index 823363bdc..06a7a3379 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -48,6 +48,7 @@ namespace ZeroTier { // These dictionary keys are short so they don't take up much room in // netconf response packets. +#define ZT_NETWORKCONFIG_DICT_KEY_NETCONF_SERVICE_VERSION "ncver" #define ZT_NETWORKCONFIG_DICT_KEY_ALLOWED_ETHERNET_TYPES "et" #define ZT_NETWORKCONFIG_DICT_KEY_NETWORK_ID "nwid" #define ZT_NETWORKCONFIG_DICT_KEY_TIMESTAMP "ts"