Look at the ip{[lowbar]}fw{[lowbar]}compat.c file for a simple layer which should make porting quite simple.