Port over L3 code.

Signed-off-by: crynobone <crynobone@gmail.com>