Skip to content

Commit

Permalink
lib.protocol.ethernet: add ptoi used by connectx driver
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Aug 30, 2021
1 parent 87128d9 commit 909dca7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/protocol/ethernet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ function ethernet:ntop (n)
return table.concat(p, ":")
end

-- Convert printable address to integer
function ethernet:ptoi (p)
return tonumber(ffi.cast("uint64_t *", ethernet:pton(p))[0])
end

-- Mapping of an IPv6 multicast address to a MAC address per RFC2464,
-- section 7
function ethernet:ipv6_mcast(ip)
Expand Down

0 comments on commit 909dca7

Please sign in to comment.