Giter Club home page Giter Club logo

Comments (7)

michalvasko avatar michalvasko commented on August 16, 2024

You can subscribe to netconf-session-start/stop notifications. However, it is not really possible to detect whether a Call Home or a standard NETCONF session was established. No other way to detect a new session.

from netopeer2.

biswajit84 avatar biswajit84 commented on August 16, 2024

As per my understanding there is a nc_session_is_callhome in libnetconf which can detect whether the session is callhome session or not ..
Is it possible to call nc_session_is_callhome from netopeer2 so that we can get the notification in our external application .
If yes please share how can we achieve it ..

from netopeer2.

michalvasko avatar michalvasko commented on August 16, 2024

Well, yes, you can call that in neotpeer2 and then put this information into the notification (after you update its YANG definition). But that requires changing netopeer2 code, which you said you do not want to do.

from netopeer2.

biswajit84 avatar biswajit84 commented on August 16, 2024

The reason which I dont want to change is:whenever we will upgrade the netopeer version should be smooth one.
As there is no other way of getting the callhome start session,then we have to modify the netopeer.
"update its YANG definition " you mean to say I am supposed to modify the netconf-session-start/stop yang file.
Whether I am supposed to invoke nc_session_is_callhome in np2srv_new_session_cb function.
Let me know whether my understanding is correct or not..

from netopeer2.

michalvasko avatar michalvasko commented on August 16, 2024

When you are modifying netopeer2 code, I think you can simply "call" your callback meaning execute the code you want when a Call Home session is created. It will be simpler than modifying the notification.

from netopeer2.

biswajit84 avatar biswajit84 commented on August 16, 2024

Hi,
I am getting Not found node with core dump.Can you please review what could be the mistake.

I have created a augmented yang file i.e notif-augment.yang having new leaf callhome-session node and installed the same using
command sysrepoctl -i notif-augment.yang -v4
$sysrepoctl --list
notif-augment | | I | biswajit:biswajit | 600 | 600 | |

pyang -f tree [email protected] notif-augment.yang
+---n netconf-session-start
| +--ro username string
| +--ro session-id nc:session-id-or-zero-type
| +--ro source-host? inet:ip-address
| +--ro aug:callhome-session? boolean

When I callhome session is being initiated by netopeer2-client, I am getting core dump with "Not found node" error message.

[ERR]: SR: Not found node "callhome-session" in path. (path "/ietf-netconf-notifications:netconf-session-start")
[WRN]: NP: Failed to send a notification (libyang error).
free(): invalid next size (fast)
Aborted (core dumped) 

diff common.c-orig common.c

462a463,467
>
> event_data[3].xpath = "/ietf-netconf-notifications:netconf-session-start/callhome-session";
>             event_data[3].type = SR_BOOL_T;
>             event_data[3].data.bool_val = nc_session_is_callhome(new_session);
>             VRB("Callhome data:%d", event_data[3].data.string_val);
464c469
<         c = sr_notif_send(np2srv.sr_sess, "/ietf-netconf-notifications:netconf-session-start", event_data, host ? 3 : 2,
---
>         c = sr_notif_send(np2srv.sr_sess, "/ietf-netconf-notifications:netconf-session-start", event_data, host ? 4 : 2, 

notif-augment.yang:

module notif-augment {
        namespace "urn:ietf:params:xml:ns:yang:augment";
        prefix aug;

        import ietf-netconf-notifications {
                prefix base;
        }

        augment "/base:netconf-session-start" {
                leaf callhome-session {
                        type boolean;
                description " It stores whether the current session is callhome session or not";
                }
        }
}

Regards,
Biswajit

from netopeer2.

michalvasko avatar michalvasko commented on August 16, 2024

It is an augment, so you must use

event_data[3].xpath = "/ietf-netconf-notifications:netconf-session-start/notif-augment:callhome-session";

I have answered you now because the issue was trivial but you are asking me to help you debug your own code, that is really not the kind of support we provide.

from netopeer2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.