Skip to content

Commit ead4c8f

Browse files
committed
doc: lyd_parse_op has special requirements when parsing notifications
As confirmed by Michal, the parsing code will try to read the `notifications` module, if it is available, or if the parsed data from the `ietf-yang-types` module are not available. As a result, a context which has not loaded the `notifications` module *and* which was not created with LY_CTX_SET_PRIV_PARSE will return an error when parsing notifications.
1 parent f202e7f commit ead4c8f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/parser_data.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ enum lyd_type {
389389
* - @p op - must be provided, the RPC/action data tree itself will be returned here, pointing to the operation;
390390
*
391391
* - ::LYD_TYPE_NOTIF_NETCONF:
392+
* - @p ctx - must either have the `notifications` module from [RFC 5277](http://tools.ietf.org/html/rfc5277)
393+
* loaded, or be created with ::LY_CTX_SET_PRIV_PARSED
392394
* - @p parent - must be NULL, the whole notification is expected;
393395
* - @p format - must be ::LYD_XML, NETCONF supports only this format;
394396
* - @p tree - must be provided, all the NETCONF-specific XML envelopes will be returned here as
@@ -411,6 +413,8 @@ enum lyd_type {
411413
* - @p op - must be NULL, @p parent points to the operation;
412414
*
413415
* - ::LYD_TYPE_NOTIF_RESTCONF:
416+
* - @p ctx - must either have the `notifications` module from [RFC 5277](http://tools.ietf.org/html/rfc5277)
417+
* loaded, or be created with ::LY_CTX_SET_PRIV_PARSED
414418
* - @p parent - must be NULL, the whole notification is expected;
415419
* - @p format - must be ::LYD_JSON, XML-formatted notifications are parsed using ::LYD_TYPE_NOTIF_NETCONF;
416420
* - @p tree - must be provided, all the RESTCONF-specific JSON objects will be returned here as

0 commit comments

Comments
 (0)