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

remove redefinition to vxlanhdr struct in vxlan dissector #1911

Merged
merged 2 commits into from
Mar 25, 2023

Conversation

mmaatuq
Copy link
Contributor

@mmaatuq mmaatuq commented Mar 22, 2023

  • vxlanhdr struct was redefined in vxlan dissector
  • in this PR @utoni asked me to remove a redefinition of vxlanhdr struct.

@IvanNardi
Copy link
Collaborator

Instead of accessing the data byte-by-byte, I think it would be cleaner if you use the structure already defined in src/include/ndpi_typedefs.h (updating it, if you think so)

@mmaatuq
Copy link
Contributor Author

mmaatuq commented Mar 25, 2023

I thought we could redefine the struct as per rfc-7348

struct ndpi_vxlanhdr{
    u_int8_t flags;
    u_int8_t reserved1[3];
    uint_8_t vni[3];
    uint_8_t reserved2;
};

after looking at some references, and how they defined rfc-7348 vxlanhdr
linux kernel

struct vxlanhdr 
   __be32 vx_flags;
   __be32 vx_vni;
};

wireshark
there is not direct definition for vxlanhdr but from the protocol dissector

struct vxlanhdr {
    u_int16_t flags;
    u_int16_t group_policy;
    u_int8_t vni[3];
    uint_8_t reserved;
};

The last definition is more convenient for nDPI (classification)

@sonarcloud
Copy link

sonarcloud bot commented Mar 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@IvanNardi IvanNardi merged commit 9ea8a57 into ntop:dev Mar 25, 2023
@IvanNardi
Copy link
Collaborator

@mmaatuq, thanks!

@mmaatuq mmaatuq deleted the remove_redifinition_for_vxlanhdr branch March 28, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants