-
Notifications
You must be signed in to change notification settings - Fork 489
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
Linux ip.Addr and ip.Link plugins #1079
Linux ip.Addr and ip.Link plugins #1079
Conversation
…xplicitily use the exception instance
Hey @ikelos I'm aware of this #1029 excellent contribution from @eve. We've already discussed this, and we agreed to collaborate, combining our efforts into one. |
@gcmoreira - looks really cool, I need to look over it properly. I certainly like pulling out the prefix into it's own column compared with #1029 - that makes it easier to work with programmatically later. +1 vote to renaming the plugins to linux.ip.addr etc to match the new linux commands. There are already a bunch of commands that were effectively renamed between vol2 and vol3 already. |
volatilityfoundation#1029 * IP address conversion via renderers.coversion.* * Use MAC address internal size instead of hardcoded. * Read NET_DEVICE_FLAGS from enumeration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, just a couple of minor points to check please. 5:)
IFF_PROMISC = 0x100 | ||
# Only for kernels < 3.15 when the net_device_flags enum didn't exist | ||
# ref include/uapi/linux/if.h | ||
NET_DEVICE_FLAGS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also looks like it could be a python Enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm here changing this to an Enum makes the code a bit complicated... have a look at how it's used in _get_flag_choices()
and _get_net_device_flag_value()
to support both kernels <3.15 and >=3.15.
Thanks @ikelos. I will have a look at this soon. I also plan to include the ip.link plugin from @eve-mem in this PR, that's why I marked it as a draft. In the meantime, could you have a look at the black formatter checks? I'm confused, as far as I understand it's failing on files which are not from this PR |
@gcmoreira - it looks nice to me. I'll run it against my collection of samples when I can. Can I help adding in |
It is, or was, github updated to black 24.1.0, so I went over the while
codebase, but it doesn't seem to get that the merge *target* updated, so
returning the task still results in the same output. 5:S. Basically if you
add a new commit, it should do a proper refresh and either pass or show you
how the new black failed it. Hard to tell if there's still something that
needs doing, but just a trivial commit will help and I figured since it was
in draft it would get added to... 5:)
…On Mon, 29 Jan 2024, 00:55 gcmoreira, ***@***.***> wrote:
Thanks @ikelos <https://github.com/ikelos>. I will have a look at this
soon. I also plan to include the ip.link plugin from @eve-mem
<https://github.com/eve-mem> in this PR, that's why I marked it as a
draft.
In the meantime, could you have a look at the black formatter checks? I'm
confused, as far as I understand it's failing on files which are not from
this PR
—
Reply to this email directly, view it on GitHub
<#1079 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALIZVIJNUJJARGODCOUILTYQ3XOXAVCNFSM6AAAAABBTT6DKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTG44TEMRTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yep, that did the trick, thanks |
@eve-mem sure, go ahead with that ;) |
…tform and, based on it, utilizes either the posixpath or ntpath modules
- On top of the @eve-mem, I've added the queue length field to mimic the ip link command. - Furthermore, I've included some functions to export the network device flags exactly as they are presented to userland
@ikelos This is now ready for review. Added testcases for both plugins |
Looks like there are some merge conflicts with this now. |
@gcmoreira could you or @atcuno resolve the merge conflicts and @atcuno could you please get this reviewed, given it's marked for the parity release? |
Also, since this wants to make a lot of changes to the LinuxUtilities class, could we try splitting it out into a utilities class, similar to the tracing stuff (#1564), so that it can be individually versioned... |
Hopefully I can fix up my breakage...
Try to patch up ruff failures through suggestions.
My bad, little typo when trying to fix it last time
Ok, this one I can't fix with a suggestion, it's too far away in the code, just needs |
80f2cc6
into
volatilityfoundation:feature/linux_ifconfig_plugin
This PR adds the
linux.ip.Addr
andlinux.ip.Link
plugins.linux.ip.Addr:
Example output:
linux.ip.Link (by @eve-mem )
Both plugins were tested with the following linux kernel versions:
See the full test case suite output:
vol3_linux_ip_addr_output.txt
vol3_linux_ip_link_output.txt