CESNET / libnetconf2

C NETCONF library
BSD 3-Clause "New" or "Revised" License
203 stars 146 forks source link

Clarification on resources (like schemes) needed on the client side #235

Closed DocDriven closed 4 years ago

DocDriven commented 4 years ago

I am trying to create a netopeer client in the same manner as the netopeer-cli. However, I think that I am missing something that I have to do to make it actually work. Take a look at this code snippet:

int main(int argc, char* argv[])
{
    nc_client_init();
    const char *host = "172.27.14.66";
    uint16_t port = 0; // uses default port
    struct nc_session *sess = NULL;

    // set user credentials to avoid typing in the pw every time
    nc_client_ssh_set_auth_pref(NC_SSH_AUTH_PASSWORD, 4);
    nc_client_ssh_set_username("root");
    nc_client_ssh_set_auth_password_clb(get_auth_password, NULL);

    // connect via SSH
    sess = nc_connect_ssh(host, port, NULL);
    if(sess == NULL)
    {
    printf("Creating NETCONF session failed\n");
    goto nc_cleanup;
    }

    // prepare and send a request
    int ret = EXIT_FAILURE;
    struct nc_rpc *rpc;
    char* filter = NULL;
    NC_WD_MODE wd = NC_WD_ALL;
    FILE *output = NULL;
    int timeout_s = 10;

    rpc = nc_rpc_get(filter, wd, NC_PARAMTYPE_CONST);
    if(!rpc)
    {
    printf("RPC creation failed\n");
    goto nc_cleanup;
    }

    uint64_t msgid;
    NC_MSG_TYPE msgtype;
    struct nc_reply *reply;

    msgtype = nc_send_rpc(sess, rpc, 1000, &msgid);
    if (msgtype == NC_MSG_ERROR)
    {
    printf("Failed to send the RPC\n");
    goto nc_cleanup;
    }
    else if (msgtype == NC_MSG_WOULDBLOCK)
    {
    printf("Timeout for sending the RPC expired\n");
    goto nc_cleanup;
    }

recv_reply:

    msgtype = nc_recv_reply(sess, rpc, msgid, 1000 * timeout_s, 0, &reply);
    if (msgtype == NC_MSG_ERROR)
    {
    printf("Failed to receive a reply\n");
    goto nc_cleanup;
    }
    else if (msgtype == NC_MSG_WOULDBLOCK)
    {
    printf("Timeout for receiving a reply expired\n");
    goto nc_cleanup;
    }
    else if (msgtype == NC_MSG_NOTIF)
    {
    goto recv_reply;
    }
    else if (msgtype == NC_MSG_REPLY_ERR_MSGID)
    {
    printf("Unexpected reply received -ignoring and waiting for the correct reply.");
    goto recv_reply;
    }

    switch (reply->type)
    {
    case NC_RPL_OK:
        printf("OK rpc reply\n");
        break;
    case NC_RPL_DATA:
        printf("DATA rpc reply\n");
        break;
    case NC_RPL_ERROR:
        printf("ERROR rpc reply\n");
        break;
    case NC_RPL_NOTIF:
        printf("notification\n");
        break;
    }

nc_cleanup:

    printf("Cleaning up netconf client resources...\n");
    nc_client_destroy();

    return 0;
}

This compiles just fine, but I do get some warnings during the execution:

libyang[1]: Identity found, but in a non-implemented module "ietf-x509-cert-to-name".
libyang[1]: Failed to resolve identityref "ietf-x509-cert-to-name:specified". (path: /netopeer-cfgnetopeer:map-type)
libyang[0]: Encountered invalid character sequence "\*"".
libyang[0]: Module "ietf-netconf-acm" parsing failed.
libyang[0]: Importing "ietf-netconf-acm" module into "ietf-netconf-server" failed.
libyang[0]: Encountered invalid character sequence "\*"".

Debugging reveals, that this happens during nc_connect_ssh, and inspecting further, I can find that the function actually throwing the warnings is nc_ctx_fill (session_client.h).

There it seems, that it tries to load some schema but cannot find them. I have unloaded all modules on my server but am still experiencing this warning. If I load a module on the server side, I even get an error: [ERR]: Session 17: malformed message received. I think this might be related.

It might be that I need some yang models on the client side? In my mind, I send a get request to the server, and receive an XML frame with the requested content. This frame can be parsed and used for whatever the app needs.

Can somebody clarify, what additional resources I need on the client side to make it work? And what causes the warnings and the error?

michalvasko commented 4 years ago

Hi, what libnetconf2 version are you using? You can also enable some messages of the library as they may be helpful. The libyang warnings can be ignored I think, but the error is because of an invalid ietf-netconf-acm module, not sure how that happened. But I would think the problem is with the module that the server is using and it is sent to the client. You would see this information in the verbose output.

Regards, Michal

DocDriven commented 4 years ago

Hi, I built libnetconf2 from source from the latest commit of the devel branch. This was due to the master branch having build issues with libssh.

I built the libnetconf2 library with debug symbols, so I think that is all I get on the client side. However, it might be helpful to include the output on the server side which I got from starting the netopeer server (1, not 2) in verbose mode (netopeer-server -v3). Note that this log includes the startup of the server as well as the get request.

netopeer-server[1738]: Shared memory location: /dev/shm/libnetconfshm
netopeer-server[1738]: POSIX SHM File Descriptor: 4 (568B).
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model ietf-inet-types.
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model ietf-yang-types.
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model ietf-netconf-monitoring.
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model ietf-netconf-notifications.
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model nc-notifications.
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model notifications.
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model ietf-netconf-with-defaults.
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model ietf-netconf-acm.
netopeer-server[1738]: ncds_set_validation: Relax NG validator set (//var/lib/libnetconf//ietf-netconf-acm-config.rng)
netopeer-server[1738]: ncds_set_validation: Schematron validator set (//var/lib/libnetconf//ietf-netconf-acm-schematron.xsl)
netopeer-server[1738]: Datastore ietf-netconf-acm initiated with ID 8.
netopeer-server[1738]: Checking the default Events stream path //var/lib/libnetconf//streams/.
netopeer-server[1738]: Adding augment model "/etc/netopeer/cfgnetopeer/ietf-x509-cert-to-name.yin"
netopeer-server[1738]: ncds_features_parse: no feature definitions found in data model ietf-x509-cert-to-name.
netopeer-server[1738]: Adding static transapi "/etc/netopeer/cfgnetopeer/ietf-netconf-server.yin"
netopeer-server[1738]: ncds_new_internal: Relax NG validator set (/etc/netopeer/cfgnetopeer/ietf-netconf-server-config.rng)
netopeer-server[1738]: ncds_new_internal: Schematron validator set (/etc/netopeer/cfgnetopeer/ietf-netconf-server-schematron.xsl)
netopeer-server[1738]: "ssh" features in "ietf-netconf-server" module enabled.
netopeer-server[1738]: "inbound-ssh" features in "ietf-netconf-server" module enabled.
netopeer-server[1738]: "outbound-ssh" features in "ietf-netconf-server" module enabled.
netopeer-server[1738]: Datastore ietf-netconf-server initiated with ID 1804289384.
netopeer-server[1738]: Setting the default SSH configuration for the ietf-netconf-server module...
netopeer-server[1738]: callback_srv_netconf_srv_listen_srv_port: SSH listening on the port 830
netopeer-server[1738]: Adding static transapi "/etc/netopeer/cfgnetopeer/netopeer-cfgnetopeer.yin"
netopeer-server[1738]: ncds_new_internal: Relax NG validator set (/etc/netopeer/cfgnetopeer/netopeer-cfgnetopeer-config.rng)
netopeer-server[1738]: ncds_new_internal: Schematron validator set (/etc/netopeer/cfgnetopeer/netopeer-cfgnetopeer-schematron.xsl)
netopeer-server[1738]: "dynamic-modules" features in "netopeer-cfgnetopeer" module enabled.
netopeer-server[1738]: "ssh" features in "netopeer-cfgnetopeer" module enabled.
netopeer-server[1738]: Datastore netopeer-cfgnetopeer initiated with ID 846930887.
netopeer-server[1738]: Setting the default configuration for the cfgnetopeer module...
netopeer-server[1738]: Setting the default configuration for the cfgnetopeer module SSH...
netopeer-server[1738]: Model "netopeer-cfgnetopeer" transAPI: there was not a single callback found for the configuration change.
netopeer-server[1738]: Netopeer server successfully initialized.
netopeer-server[1738]: SSH log: ssh_socket_pollcallback: Received POLLOUT in connecting state
netopeer-server[1738]: SSH log: callback_receive_banner: Received banner: SSH-2.0-libssh_0.8.90
netopeer-server[1738]: SSH log: ssh_server_connection_callback: SSH client banner: SSH-2.0-libssh_0.8.90
netopeer-server[1738]: SSH log: ssh_analyze_banner: Analyzing banner: SSH-2.0-libssh_0.8.90
netopeer-server[1738]: SSH log: packet_send2: packet: wrote [len=460,padding=10,comp=449,payload=449]
netopeer-server[1738]: SSH log: ssh_socket_unbuffered_write: Enabling POLLOUT for socket
netopeer-server[1738]: SSH log: ssh_packet_socket_callback: packet: read type 20 [len=924,padding=4,comp=919,payload=919]
netopeer-server[1738]: SSH log: ssh_packet_process: Dispatching handler for packet type 20
netopeer-server[1738]: SSH log: crypt_set_algorithms_server: Set output algorithm aes256-ctr
netopeer-server[1738]: SSH log: crypt_set_algorithms_server: Set input algorithm aes256-ctr
netopeer-server[1738]: SSH log: crypt_set_algorithms_server: Set HMAC output algorithm to hmac-sha2-256
netopeer-server[1738]: SSH log: crypt_set_algorithms_server: Set HMAC input algorithm to hmac-sha2-256
netopeer-server[1738]: SSH log: ssh_packet_socket_callback: packet: read type 30 [len=268,padding=5,comp=262,payload=262]
netopeer-server[1738]: SSH log: ssh_packet_process: Dispatching handler for packet type 30
netopeer-server[1738]: SSH log: ssh_packet_kexdh_init: Received SSH_MSG_KEXDH_INIT
netopeer-server[1738]: SSH log: ssh_socket_unbuffered_write: Enabling POLLOUT for socket
netopeer-server[1738]: SSH log: packet_send2: packet: wrote [len=828,padding=8,comp=819,payload=819]
netopeer-server[1738]: SSH log: packet_send2: packet: wrote [len=12,padding=10,comp=1,payload=1]
netopeer-server[1738]: SSH log: dh_handshake_server: SSH_MSG_NEWKEYS sent
netopeer-server[1738]: SSH log: ssh_socket_unbuffered_write: Enabling POLLOUT for socket
netopeer-server[1738]: SSH log: ssh_packet_socket_callback: packet: read type 21 [len=12,padding=10,comp=1,payload=1]
netopeer-server[1738]: SSH log: ssh_packet_process: Dispatching handler for packet type 21
netopeer-server[1738]: SSH log: ssh_packet_newkeys: Received SSH_MSG_NEWKEYS
netopeer-server[1738]: SSH log: ssh_handle_key_exchange: ssh_handle_key_exchange: current state : 7
netopeer-server[1738]: Received an SSH message "request-service" of subtype "ssh-userauth".
netopeer-server[1738]: Received an SSH message "request-auth" of subtype "none".
netopeer-server[1738]: Received an SSH message "request-auth" of subtype "password".
netopeer-server[1738]: User 'root' authenticated.
netopeer-server[1738]: Received an SSH message "request-channel-open" of subtype "session".
netopeer-server[1738]: Received an SSH message "request-channel" of subtype "subsystem".
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.0</capability>
    <capability>urn:ietf:params:netconf:base:1.1</capability>
    <capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:startup:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:interleave:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:notification:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
    <capability>urn:ietf:params:netconf:capability:validate:1.1</capability>
    <capability>urn:ietf:params:netconf:capability:with-default
netopeer-server[1738]: Received message (session 1): <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><capabilities><capability>urn:ietf:params:netconf:base:1.0</capability><capability>urn:ietf:params:netconf:base:1.1</capability></capabilities></hello>
netopeer-server[1738]: Adding new event (5)
netopeer-server[1738]: Created session 1 for user 'root' (UID 0) (recovery)
netopeer-server[1738]: New server session for 'root' with ID 1
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-netconf</identifier><version>2011-03-08</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-netconf" {
  namespace "urn:ietf:params:xml:ns:netconf:base:1.0";
  prefix "nc";
  import "ietf-inet-types" {
    prefix "inet";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
WG List:  &lt;mailto:netconf@ietf.org&gt;

WG Chair: Bert Wijnen
          &lt;mailto:bertietf@bwijnen.net&gt;

WG Chair: Mehmet Ersue
          &lt;mailto:mehmet.ersue@nsn.com&gt;

Editor:   Martin Bjorklund
          &lt;mailto:mbj@tail-f.com&gt;

Editor:   Juergen Schoenwaelder
          &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;

Editor:   Andy Bierman
          &lt;mailto:andy.bierman@brocade.com&gt;";
  description
    "NETCONF Protocol Data Types an
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>netopeer-cfgnetopeer</identifier><version>2015-05-19</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "netopeer-cfgnetopeer" {
  namespace "urn:cesnet:tmc:netopeer:1.0";
  prefix "cfgnetopeer";
  import "ietf-x509-cert-to-name" {
    prefix "x509c2n";
  }

  organization
    "CESNET, z.s.p.o.";
  contact
    "mvasko@cesnet.cz,
 dkupka@cesnet.cz";
  description
    "Module specifying Netopeer module data model and RPC operation.";
  revision "2015-05-19" {
    description
      "client-removal-time removed, dynamic modules are an optional feature.";
  }

  revision "2015-01-15" {
    description
      "Netopeer-specific NETCONF server options added.";
  }

  revision "2013-02-14" {
    description
      "Modules are now configurable. Except implemented-rpcs which depends on module data model.";
  }

  revision "2012-11-13" {
    description
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-x509-cert-to-name</identifier><version>2013-03-26</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-x509-cert-to-name" {
  namespace "urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name";
  prefix "x509c2n";
  import "ietf-yang-types" {
    prefix "yang";
  }

  organization
    "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netmod/&gt;
WG List:  &lt;mailto:netmod@ietf.org&gt;

WG Chair: David Kessens
          &lt;mailto:david.kessens@nsn.com&gt;

WG Chair: Juergen Schoenwaelder
          &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;

Editor:   Martin Bjorklund
          &lt;mailto:mbj@tail-f.com&gt;

Editor:   Juergen Schoenwaelder
          &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;";
  description
    "This module contains a collection of YANG de
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-netconf-server</identifier><version>2014-01-24</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-netconf-server" {
  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-server";
  prefix "ncserver";
  import "ietf-yang-types" {
    prefix "yang";
  }

  import "ietf-inet-types" {
    prefix "inet";
  }

  import "ietf-x509-cert-to-name" {
    prefix "x509c2n";
  }

  import "ietf-netconf-acm" {
    prefix "nacm";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
WG List:  &lt;mailto:netconf@ietf.org&gt;

WG Chair: Mehmet Ersue
          &lt;mailto:mehmet.ersue@nsn.com&gt;

WG Chair: Bert Wijnen
          &lt;mailto:bertietf@bwijnen.net&gt;

Editor:   Juergen Schoenwaelder
          &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;

netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-netconf-acm</identifier><version>2012-02-22</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-netconf-acm" {
  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm";
  prefix "nacm";
  import "ietf-yang-types" {
    prefix "yang";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
WG List:  &lt;mailto:netconf@ietf.org&gt;

WG Chair: Mehmet Ersue
          &lt;mailto:mehmet.ersue@nsn.com&gt;

WG Chair: Bert Wijnen
          &lt;mailto:bertietf@bwijnen.net&gt;

Editor:   Andy Bierman
          &lt;mailto:andy@yumaworks.com&gt;

Editor:   Martin Bjorklund
          &lt;mailto:mbj@tail-f.com&gt;";
  description
    "NETCONF Access Control Model.

Copyright (c) 2012 IETF Trust and the persons identified as
authors of the code.  All rig
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-netconf-acm</identifier><version>2012-02-22</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-netconf-acm" {
  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-acm";
  prefix "nacm";
  import "ietf-yang-types" {
    prefix "yang";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
WG List:  &lt;mailto:netconf@ietf.org&gt;

WG Chair: Mehmet Ersue
          &lt;mailto:mehmet.ersue@nsn.com&gt;

WG Chair: Bert Wijnen
          &lt;mailto:bertietf@bwijnen.net&gt;

Editor:   Andy Bierman
          &lt;mailto:andy@yumaworks.com&gt;

Editor:   Martin Bjorklund
          &lt;mailto:mbj@tail-f.com&gt;";
  description
    "NETCONF Access Control Model.

Copyright (c) 2012 IETF Trust and the persons identified as
authors of the code.  All rig
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-netconf-with-defaults</identifier><version>2010-06-09</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-netconf-with-defaults" {
  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults";
  prefix "ncwd";
  import "ietf-netconf" {
    prefix "nc";
  }

  organization
    "IETF NETCONF (Network Configuration Protocol) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
WG List:  &lt;mailto:netconf@ietf.org&gt;

WG Chair: Bert Wijnen
          &lt;mailto:bertietf@bwijnen.net&gt;

WG Chair: Mehmet Ersue
          &lt;mailto:mehmet.ersue@nsn.com&gt;

Editor: Andy Bierman
        &lt;mailto:andy.bierman@brocade.com&gt;

Editor: Balazs Lengyel
        &lt;mailto:balazs.lengyel@ericsson.com&gt;";
  description
    "This module defines an extension to the NETCONF protocol
that allows the NETCONF client
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="8"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-netconf</identifier><version>2011-03-08</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="8">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-netconf" {
  namespace "urn:ietf:params:xml:ns:netconf:base:1.0";
  prefix "nc";
  import "ietf-inet-types" {
    prefix "inet";
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
WG List:  &lt;mailto:netconf@ietf.org&gt;

WG Chair: Bert Wijnen
          &lt;mailto:bertietf@bwijnen.net&gt;

WG Chair: Mehmet Ersue
          &lt;mailto:mehmet.ersue@nsn.com&gt;

Editor:   Martin Bjorklund
          &lt;mailto:mbj@tail-f.com&gt;

Editor:   Juergen Schoenwaelder
          &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;

Editor:   Andy Bierman
          &lt;mailto:andy.bierman@brocade.com&gt;";
  description
    "NETCONF Protocol Data Types an
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>notifications</identifier><version>2008-07-14</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="9">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "notifications" {
  namespace "urn:ietf:params:xml:ns:netconf:notification:1.0";
  prefix "ncEvent";
  import "ietf-yang-types" {
    prefix "yang";
  }

  organization
    "IETF NETCONF WG";
  contact
    "netconf@ops.ietf.org";
  description
    "Conversion of the 'ncEvent' XSD in the 
NETCONF Notifications RFC.";
  reference
    "RFC 5277.";
  revision "2008-07-14" {
    description
      "RFC 5277 version.";
  }

  typedef "streamNameType" {
    description
      "The name of an event stream.";
    type "string";
  }

  rpc "create-subscription" {
    description
      "The command to create a notification subscription. It
takes as argument the name of the notification stream
and filter. Both of those options limit the content of
the s
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>nc-notifications</identifier><version>2008-07-14</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="10">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "nc-notifications" {
  namespace "urn:ietf:params:xml:ns:netmod:notification";
  prefix "manageEvent";
  import "ietf-yang-types" {
    prefix "yang";
  }

  import "notifications" {
    prefix "ncEvent";
  }

  organization
    "IETF NETCONF WG";
  contact
    "netconf@ietf.org";
  description
    "Conversion of the 'manageEvent' XSD in the NETCONF
Notifications RFC.";
  reference
    "RFC 5277";
  revision "2008-07-14" {
    description
      "RFC 5277 version.";
  }

  container "netconf" {
    description
      "Top-level element in the notification namespace";
    config "false";
    container "streams" {
      description
        "The list of event streams supported by the system. When
a query is issued, the returned set of streams 
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="11"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>notifications</identifier><version>2008-07-14</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="11">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "notifications" {
  namespace "urn:ietf:params:xml:ns:netconf:notification:1.0";
  prefix "ncEvent";
  import "ietf-yang-types" {
    prefix "yang";
  }

  organization
    "IETF NETCONF WG";
  contact
    "netconf@ops.ietf.org";
  description
    "Conversion of the 'ncEvent' XSD in the 
NETCONF Notifications RFC.";
  reference
    "RFC 5277.";
  revision "2008-07-14" {
    description
      "RFC 5277 version.";
  }

  typedef "streamNameType" {
    description
      "The name of an event stream.";
    type "string";
  }

  rpc "create-subscription" {
    description
      "The command to create a notification subscription. It
takes as argument the name of the notification stream
and filter. Both of those options limit the content of
the 
netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="12"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ietf-netconf-notifications</identifier><version>2012-02-06</version><format>yang</format></get-schema></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="12">
  <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module "ietf-netconf-notifications" {
  namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications";
  prefix "ncn";
  import "ietf-inet-types" {
    prefix "inet";
  }

  import "ietf-netconf" {
    prefix "nc";
  }

  organization
    "IETF NETCONF (Network Configuration Protocol) Working Group";
  contact
    "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
WG List:  &lt;mailto:netconf@ietf.org&gt;

WG Chair: Bert Wijnen
          &lt;mailto:bertietf@bwijnen.net&gt;

WG Chair: Mehmet Ersue
          &lt;mailto:mehmet.ersue@nsn.com&gt;

Editor:   Andy Bierman
          &lt;mailto:andy@netconfcentral.org&gt;";
  description
    "This module defines a YANG data model for use with the
NETCONF protocol that allows the NETCONF client to

netopeer-server[1738]: Received message (session 1): <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="13"><get xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><with-defaults xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">report-all</with-defaults></get></rpc>
netopeer-server[1738]: [truncated] Writing message (session 1): <?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="13">
  <data>
    <netopeer xmlns="urn:cesnet:tmc:netopeer:1.0">
      <modules>
      </modules>
      <hello-timeout>600</hello-timeout>
      <idle-timeout>3600</idle-timeout>
      <max-sessions>8</max-sessions>
      <response-time>50</response-time>
      <ssh>
        <server-keys>
          <rsa-key>/etc/ssh/ssh_host_rsa_key</rsa-key>
        </server-keys>
        <password-auth-enabled>true</password-auth-enabled>
        <auth-attempts>3</auth-attempts>
        <auth-timeout>10</auth-timeout>
      </ssh>
    </netopeer>
    <netconf xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server">
      <ssh>
        <listen>
          <port>830</port>
        </listen>
      </ssh>
    </netconf>
    <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
      <capabilities>
        <capabili

I am quite sure that I did not write a yang-model for the ietf-netconf-acm module. It seems that it came with the netopeer server itself.

michalvasko commented 4 years ago

Hi, oh my, you are using the ancient netopeer-server, which was the 1st generation, we are now on the 3rd at least. No wonder there is some weird ietf-netconf-acm module used. Sorry, but you are on your own with this server.

Regards, Michal

DocDriven commented 4 years ago

Hi, I get your point, but upgrading the server is a very time consuming process because we cross-compile it for another platform via buildroot.As I understand it, both client and server should be able to communicate via NETCONF regardless of their versions.

If this is not the case, I might try to use libnetconf v1 for the client to avoid problems of these sort. If you know something about the compat issues, please let me know. I will try it with the older version then.

michalvasko commented 4 years ago

Hi, yeah, you can try using a libnetconf client, it may work. But if it does not, we will not provide any support.

Regards, Michal

DocDriven commented 4 years ago

Alright, thanks for your help again.

Closing this issue.