Creating portable and efficient packet processing applications