tcpdump icon indicating copy to clipboard operation
tcpdump copied to clipboard

rt6: parse TLV

Open giulio-sido opened this issue 4 years ago • 7 comments

Parse Type Length Values (TLV) in IPv6 Routing Header as specified by RFC 8754 [1].

[1] https://datatracker.ietf.org/doc/html/rfc8754

Signed-off-by: Giulio Sidoretti [email protected]

giulio-sido avatar Oct 25 '21 15:10 giulio-sido

Thanks for your comments, I have added these minor changes

giulio-sido avatar Nov 04 '21 10:11 giulio-sido

@fxlb any update on this PR ?

@giulio-sido There is a couple of SRH TLVs defined in https://datatracker.ietf.org/doc/html/draft-ietf-spring-sr-service-programming-05#section-7.2.1. They are still waiting for Type assignment by IANA. When they get assigned a type, will you be willing to send one more PR to support them ?

Thanks!

ahsalam avatar Nov 10 '21 14:11 ahsalam

@giulio-sido There is a couple of SRH TLVs defined in https://datatracker.ietf.org/doc/html/draft-ietf-spring-sr-service-programming-05#section-7.2.1. They are still waiting for Type assignment by IANA. When they get assigned a type, will you be willing to send one more PR to support them ?

Sure. In the meantime, all TLVs with types that are not in the RFC 8754 are parsed as generic TLVs.

giulio-sido avatar Nov 10 '21 14:11 giulio-sido

@giulio-sido There is a couple of SRH TLVs defined in https://datatracker.ietf.org/doc/html/draft-ietf-spring-sr-service-programming-05#section-7.2.1. They are still waiting for Type assignment by IANA. When they get assigned a type, will you be willing to send one more PR to support them ?

Sure. In the meantime, all TLVs with types that are not in the RFC 8754 are parsed as generic TLVs.

Great, thanks Giulio!

ahsalam avatar Nov 10 '21 14:11 ahsalam

Hi @fxlb, could you please have a look on that PR? we have other new features that we plan to submit but they depend on that PR. thanks!

ahsalam avatar May 27 '22 07:05 ahsalam

Hi, I have just rebased yesterday because the main repository had advanced and there was a little conflict to solve. Now the checks have all passed, so the PR should be ready.

giulio-sido avatar May 27 '22 08:05 giulio-sido

Please have patience, I have no time for a review now. Maybe another maintainer will have time to review the changes.

fxlb avatar Jun 01 '22 18:06 fxlb

First, some questions: You process three IPV6_SRH_TLV_* and the default.

  1. Why 2 IPV6_SRH_TLV_* are cases of the switch and IPV6_SRH_TLV_PAD1 is outside the switch with a 'continue'?
  2. Have you some pcap files with pad1 and padn TLVs?

fxlb avatar Oct 15 '22 15:10 fxlb

(I have rebased your branch on top the-tcpdump-group:master, please get the updated branch.)

fxlb avatar Oct 15 '22 15:10 fxlb

Hi @fxlb, sorry for the late reply. I'll answer your questions.

  1. I have chosen to parse the IPV6_SRH_TLV_PAD1 outside the switch statement because in that case there is not a further byte to read containing the TLV length, which is found in all the other TLVs. I thought it would have been cleaner this way, but I'm open to changes in the code if you think I should implement the logic differently.

  2. I have added a new pcap file containing an example with the padding TLVs with relative test.

The CI tests are still running as of now, but hopefully everything will work. Let me know if you have any more comments.

Thanks for your time!

giulio-sido avatar Nov 11 '22 18:11 giulio-sido

Hi @fxlb, I have edited a file because it didn't pass one check. There were a couple trailing spaces.

giulio-sido avatar Jan 17 '23 12:01 giulio-sido

I have chosen to parse the IPV6_SRH_TLV_PAD1 outside the switch statement because [...]

OK.

I have added a new pcap file containing an example with the padding TLVs with relative test.

Thanks.

fxlb avatar Apr 16 '23 14:04 fxlb

Thaks @fxlb for your feedback. I have updated the code and rebased on the last commit of the master. Let's wait for the CI tests to finish.

giulio-sido avatar Apr 17 '23 15:04 giulio-sido

Put "{" at end of line with "if", "for" and "while" to keep style consistent. Done.

fxlb avatar Apr 18 '23 12:04 fxlb

@giulio-sido Thank you for your work and patience.

fxlb avatar Apr 18 '23 12:04 fxlb