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

Add: Add function to get the local mac address #922

Merged
merged 4 commits into from
Nov 7, 2021

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Nov 2, 2021

What:
Add function to get the local mac address from the local IP address. Support Ipv4 and IPv6.
Jira: SC-382

Why:
To get the local mac associated to an IP.

How:

run the following script. (Use IP addresses set in your system).

mac_ipv4 = get_local_mac_address_from_ip ("192.168.0.9");
display (mac_ipv4);

mac_ipv6 = get_local_mac_address_from_ip ("344f::ff44");
display (mac_ipv4);

Checklist:

  • Tests
  • PR merge commit message adjusted

@jjnicola jjnicola changed the title Add: Add function to get the mac address associated an IP address Add: Add function to get the local mac address associated an IP address Nov 3, 2021
@jjnicola jjnicola changed the title Add: Add function to get the local mac address associated an IP address Add: Add function to get the local mac address Nov 3, 2021
@jjnicola jjnicola marked this pull request as ready for review November 3, 2021 10:29
@jjnicola jjnicola requested a review from a team as a code owner November 3, 2021 10:29
@jjnicola jjnicola enabled auto-merge (squash) November 3, 2021 10:30
@jjnicola jjnicola merged commit b85698b into greenbone:main Nov 7, 2021
mergify bot pushed a commit that referenced this pull request Nov 8, 2021
* Add function to get the local mac address associated to the local ip

* Extend the function for ipv6 support

* Fix ipv6 support

Use ntop also for ipv4. Improve code

(cherry picked from commit b85698b)
jjnicola added a commit that referenced this pull request Nov 8, 2021
* Add function to get the local mac address associated to the local ip

* Extend the function for ipv6 support

* Fix ipv6 support

Use ntop also for ipv4. Improve code

(cherry picked from commit b85698b)

Co-authored-by: Juan José Nicola <jjnicola@gmail.com>
mergify bot pushed a commit that referenced this pull request Nov 8, 2021
* Add function to get the local mac address associated to the local ip

* Extend the function for ipv6 support

* Fix ipv6 support

Use ntop also for ipv4. Improve code

(cherry picked from commit b85698b)
jjnicola added a commit that referenced this pull request Nov 8, 2021
* Add function to get the local mac address associated to the local ip

* Extend the function for ipv6 support

* Fix ipv6 support

Use ntop also for ipv4. Improve code

(cherry picked from commit b85698b)

Co-authored-by: Juan José Nicola <jjnicola@gmail.com>
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.

3 participants