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

convert bytefields in common to usable fields #25

Open
nopeslide opened this issue Feb 21, 2024 · 1 comment
Open

convert bytefields in common to usable fields #25

nopeslide opened this issue Feb 21, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@nopeslide
Copy link
Contributor

Instead of having a handy way to quickly instantiate the various protocols in common as standalone bytefield,
lets make them fields, that can be used in other bytefields.
these fields may allow their internal fields to be overwritten via arguments

#bytefield(
  ip(
    data: tcp(
      dst_port: [80] // set internal field content 
      src_port: bytes(2)[#box(width:100%,height:100%,fill:grey)[random]] //replace internal field
    )[
      GET ...
    ]
  )
)
@nopeslide nopeslide changed the title make bytefields in common to usable fields convert bytefields in common to usable fields Feb 21, 2024
@jomaway
Copy link
Owner

jomaway commented Feb 21, 2024

Sounds like a good idea.
But maybe we can even support both versions like common.ipv4 just stays like it is and common.fields.ipv4 returns the field or something similar.

Happy to accept a PR if you like to implement this. Otherwise i put it on the list for future plans.

@jomaway jomaway added the enhancement New feature or request label Mar 9, 2024
@jomaway jomaway added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants