CESNET / libnetconf

C NETCONF library
Other
113 stars 84 forks source link

libnetconf generating wrong NETCONF-CONFIG-CHANGE notification. #161

Closed harshawasthi90 closed 8 years ago

harshawasthi90 commented 8 years ago

Hi all, I am using 0.9 version of libnetconf.

I am running both netopeer-server and client on same machine.

On client side I am subscribing to the events by entering subscribe command. As soon as I use edit-config running, I get a notification of NETCONF-CONFIG-CHANGE.

<netconf-config-change xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications">
    <datastore>running</datastore>
    <username>root</username>
    <session-id>9</session-id>
    <source-host/>
</netconf-config-change>

But the problem is, this notification that I get doesn't agree with the yang model used by libnetconf. See the following link for.. ietf-netconf-notifications.yang (https://github.com/CESNET/libnetconf/blob/0.9.x/models/ietf-netconf-notifications.yang)

Correct notification would be something like

<netconf-config-change xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications">
    <datastore>running</datastore>
    <changed-by>
        <username>root</username>
        <session-id>9</session-id>
    </changed-by>
    <source-host/>
</netconf-config-change>

Actually I am using Opendaylight conntroller to connect to netconf server and I am subscribing the default event stream. When I get the NETCONF-CONFIG-CHANGE notification, I get an error because of the model mismatch.

What can i do to resolve this problem?

michalvasko commented 8 years ago

Hi, you should use libnetconf 0.10.0, it is fixed there.

Regards, Michal

harshawasthi90 commented 8 years ago

great... Thanks...

harshawasthi90 commented 8 years ago

is there any patch for resolving the issue? I am using netopper 0.9 which i think is not compatible with libnetconf 10.

michalvasko commented 8 years ago

You can only patch it yourself, if you cherry-pick commit 2a74f825 to your libnetconf 0.9.0, it should work.

harshawasthi90 commented 8 years ago

got it.... its working after the changes... Plus following change will be required to...

session->hostname ? session->hostname : "0.0.0.0")

thanks...:)