Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String Support for Adding Custom TLVs #546

Open
avlec opened this issue Sep 9, 2022 · 3 comments
Open

String Support for Adding Custom TLVs #546

avlec opened this issue Sep 9, 2022 · 3 comments

Comments

@avlec
Copy link

avlec commented Sep 9, 2022

The LLDP standard specifies alpha-numeric data shall be encoded as UTF-8 in TLVs in Section 8.4.3. This seems to apply to custom-tlvs as well because the custom-tlv section of the standard specifies in Section 8.6 "Organizationally Specific TLVs shall conform to 8.4 and 8.6.1" and in in Section 8.6.1.5 explicitly states "Alpha-numeric information should be encoded in UTF-8".

A mechanism could be added to lldpcli to support entering text that gets ascii encoded. This would make it easier to comply with the standards idea of how this data should be encoded.

From that the suggested new supplemental command format (first command below) would be equivalent to the current way of doing things (second command below). Will probably need some modification to sort out ambiguities.

# lldpcli configure lldp custom-tlv oui 00,00,00 subtype 1 oui-info "encoded as utf-8"
# lldpcli configure lldp custom-tlv oui 00,00,00 subtype 1 oui-info 65,6e,63,6f,64,65,64,20,61,73,20,75,74,66,2d,38
@vincentbernat
Copy link
Member

Yes, we could do that. I would suggest to add oui-info-str to avoid ambiguity (quoting is done before evaluation of a command, so you cannot know if a string was quoted or not). This is likely doable just by modifying src/lldpcli/conf-lldp.c.

@avlec
Copy link
Author

avlec commented Sep 9, 2022

Yes! I updated my original comment to be a bit more explict/careful with wording.

@shalmali-l
Copy link

Hey, I made a change to type oui-info to accept strings. So my local copy of this now supports strings passed in. I can submit it as a patch to this repo. cc: @vincentbernat

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

No branches or pull requests

3 participants