move ip related functions and data structures to a separate header file