Packet processing file, incomplete, issues with casting