Skip to content

Commit

Permalink
Further documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Scholz committed Aug 27, 2015
1 parent 6c8a48d commit 76cfc36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lua/include/ipsec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ end
--- Read AES 128 bit Key and Salt from the Hardware TX SA table
--- @param port The port/interface to use
--- @param idx Index into the TX SA table (0-1023)
--- @param return Key and Salt (as hex string)
--- @return Key and Salt (as hex string)
function mod.tx_get_key(port, idx)
if idx > 1023 or idx < 0 then
error("Idx must be in range 0-1023")
Expand Down Expand Up @@ -444,7 +444,7 @@ end
--- @param port The port/interface to use
--- @param idx Index into the RX IP table (0-127)
--- @param is_ipv4 IP Version expected (true/false)
--- @param return The IP(v4/v6)-Address (as string) and a IP Version Flag (true=IPv4, false=IPv6)
--- @return The IP(v4/v6)-Address (as string) and a IP Version Flag (true=IPv4, false=IPv6)
function mod.rx_get_ip(port, idx, is_ipv4)
if idx > 127 or idx < 0 then
error("Idx must be in range 0-127")
Expand Down
12 changes: 7 additions & 5 deletions lua/include/packet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ function pkt:dump(bytes)
end

-------------------------------------------------------------------------------------------------------
--- IPSec offloading
---- IPSec offloading
-------------------------------------------------------------------------------------------------------

-- @idx SA_IDX to use
-- @sec_type IPSec type to use ("esp"/"ah")
-- @esp_mode ESP mode to use encrypt(1) or authenticate(0)
--- Use IPsec offloading.
--- @param idx SA_IDX to use
--- @param sec_type IPSec type to use ("esp"/"ah")
--- @param esp_mode ESP mode to use encrypt(1) or authenticate(0)
function pkt:offloadIPSec(idx, sec_type, esp_mode)
local mode = esp_mode or 0
local t = nil
Expand Down Expand Up @@ -152,7 +153,8 @@ function pkt:offloadIPSec(idx, sec_type, esp_mode)
self.ol_ipsec.data = bit.bor(self.ol_ipsec.data, bit.lshift(bit.band(t, 0x1), 19))
end

-- @len ESP Trailer length in bytes
--- Set the ESP trailer length
--- @param len ESP Trailer length in bytes
function pkt:setESPTrailerLength(len)
--Disable range check for performance reasons
--if len < 0 or len > 511 then
Expand Down

0 comments on commit 76cfc36

Please sign in to comment.