You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the transapi_init() function to change the startup configuration of my device, I'm writing my tree in the *running xmlDocPtr and I know it's correct because I'm dumping it in a text file (using xmlDocDump), and then I'm reading this file and I'm putting its content inside a const char * data, and it is copied to the string data successfully because I'm printing it in another file, and I'm using the below function to edit the startup config :
rpcedited directory is created which means the rpc value is not NULL but the startup configuration never changes. Can you help me please?
Note that I transformed the xmlDocPtr to a const char * because that's what nc_rpc_editconfig requires.
The text was updated successfully, but these errors were encountered:
Hi,
if I understand your problem correctly then you are mistaken about what transapi_init() is supposed to do, because you cannot change startup using it. What it is supposed to do is analyze the current system state, create the configuration accordingly so that afterwards, when startup is copied into running, the final state really conforms to startup. This is also written in our tutorial, point 3.
If you want to execute edit-config on a datastore, you generally must send such an RPC to the server. You can do (fake) this from inside the server using dummy sessions. You can find an example of this in our netopeer cfgsystem init utility.
I'm using the transapi_init() function to change the startup configuration of my device, I'm writing my tree in the *running xmlDocPtr and I know it's correct because I'm dumping it in a text file (using xmlDocDump), and then I'm reading this file and I'm putting its content inside a const char * data, and it is copied to the string data successfully because I'm printing it in another file, and I'm using the below function to edit the startup config :
rpc = nc_rpc_editconfig(NC_DATASTORE_STARTUP, NC_DATASTORE_CONFIG,0,0,0,data);
if(rpc==NULL) system("mkdir /root/logs/rpcerror");
else system("mkdir /root/logs/rpcedited");
rpcedited directory is created which means the rpc value is not NULL but the startup configuration never changes. Can you help me please?
Note that I transformed the xmlDocPtr to a const char * because that's what nc_rpc_editconfig requires.
The text was updated successfully, but these errors were encountered: