Skip to content

opaque node parsing #2388

Open
Open
@siprab

Description

@siprab

Hi,

When any node parsed with invalid value libyang parses it as an opaque node and on netopeer2-cli the edit-config operation does not throws any error.

Now we have a scenario where we want to send error to netopeer-cli client if the value is parsed is not valid. Could you pls suggest how to do that.

Activity

michalvasko

michalvasko commented on Apr 28, 2025

@michalvasko
Member

Opaque nodes are accepted only in a few specific cases, otherwise an error from netopeer2 is returned. It is not clear what exactly you want to do but if to change the behavior of netopeer2, you cannot do that without changing its code.

siprab

siprab commented on Apr 28, 2025

@siprab
Author

Hi Michal,

We have a leaf-list node of type string which we have deviated to accept only specific string as its value using pattern. So when doing edit-config for that node with a value other than specified strings, on netopeer-cli the edit-config operation getting return as OK but in netopeer log we have log like below:

netopeer2-server|INFO "netopeer2-server-log" [INF]: LY: Parsing opaque term node "notificationTypes" with invalid value "xyz".
netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Published event "rpc" "/ietf-netconf:edit-config" with ID 7 priority 0 for 1 subscribers.
netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Processing "/ietf-netconf:edit-config" "rpc" event with ID 7 priority 0 (remaining 1 subscribers).
netopeer2-server|INFO "netopeer2-server-log" [INF]: NP: edit-config error-option "stop-on-error" not supported, rollback-on-error will be performed.
netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: No datastore changes to apply.
netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Successful processing of "rpc" event with ID 7 priority 0 (remaining 0 subscribers).
netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Event "rpc" with ID 7 priority 0 succeeded.
netopeer2-server|INFO "netopeer2-server-log" [INF]: NP: Session 17: thread 3 event new RPC.
michalvasko

michalvasko commented on Apr 28, 2025

@michalvasko
Member

The server should respond with an error but for some reason it detects no changes. Can you post the YANG data you have on the server and the exact edit-config you are sending?

siprab

siprab commented on Apr 28, 2025

@siprab
Author

Hi Michal,
attached the yang files, deviation statement is present in "deviation_du_modify.yang" and the edit-config data is as below:

<ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element"> <id>1</id> <NtfSubscriptionControl> <id>1_cm</id> <attributes> <notificationRecipientAddress>https://10.20.30.40:9993/eventListener/v7/</notificationRecipientAddress> <notificationTypes>xyz</notificationTypes> </attributes> </NtfSubscriptionControl> </ManagedElement>

yang_files.zip

Thanks

michalvasko

michalvasko commented on Apr 28, 2025

@michalvasko
Member

I also need the "current" data you have stored of _3gpp-common-managed-element on the server.

siprab

siprab commented on Apr 28, 2025

@siprab
Author

Hi Michal,

below is the current data on the server:

> get --filter-xpath /_3gpp-common-managed-element:ManagedElement[id]/NtfSubscriptionControl[id]
DATA
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element">
<id>1</id>
<NtfSubscriptionControl>
<id>1_cm</id>
<attributes>
<notificationRecipientAddress>[https://10.20.30.40:9993/eventListener/v7/</notificationRecipientAddress>](https://10.20.30.40:9993/eventListener/v7/%3C/notificationRecipientAddress%3E)
<notificationTypes>notifyMOIChanges</notificationTypes>
</attributes>
<HeartbeatControl>
<id>1</id>
<attributes>
<heartbeatNtfPeriod>600</heartbeatNtfPeriod>
</attributes>
</HeartbeatControl>
</NtfSubscriptionControl>
</ManagedElement>

Thanks

michalvasko

michalvasko commented on Apr 29, 2025

@michalvasko
Member

You are missing an instance of a mandatory node priorityLabel in /_3gpp-common-managed-element:ManagedElement[id='1']/attributes so I do not know how you can have that data on the server, it does not allow setting invalid data. So I am not able to help you if you do not accurately describe your use-case. Also, what version of netopeer2 are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:questionIssue is actually a question.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @michalvasko@siprab

        Issue actions

          opaque node parsing · Issue #2388 · CESNET/libyang