Comments (7)
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.
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.
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.
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.
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.
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.
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)
- netopeer2.conf and pam_nologin.so does not exist in Yocto Scarthgap HOT 3
- netopeer2-server: /home/ubuntn/libyang-2.0.112/src/parser_xml.c:696: lydxml_subtree_r: Assertion `xmlctx->status == LYXML_ELEM_CLOSE' failed. Aborted (core dumped) HOT 1
- TLS server cipher regarding HOT 7
- Complete example for callback mechanism e.g when changing/reading some field via netopeer2-server HOT 2
- NOT support password customization authentication function in new version HOT 7
- Call home to loopback IP is failing HOT 4
- Netopeer2-cli does not detect connection breakage in the background HOT 3
- A potential mistake need to be tested and verified HOT 1
- Does netopeer-cli support public key based authentication HOT 4
- Cannot connect Server HOT 8
- Query on listing existing subscriptions HOT 15
- Query: any API to terminate the particular client's netconf session with particular user from application HOT 5
- New SSH server key added every time I trigger a call-home, not checking the known_host file. HOT 1
- Failed changing permissions of directory "/usr/lib64/netopeer2-server" (Read-only file system) HOT 2
- Unable to receive callback when trying to subscribe custom yang model using sr_oper_get_subscribe() HOT 1
- Delete subinterface and network-instance not working with netopeer2 HOT 4
- Error with TLS Call Home connection using netopeer2-cli HOT 2
- netopeer2-server dont open port in openwrt HOT 6
- Example configuration xml tags are not aligned with yang modules HOT 3
- The "apkg build" breaks due pam.de/netopeer2.conf path issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netopeer2.