Improve checksum calculation and address checking

1. Add a function that calculates the checksum of all the packet
   components starting from the specified position. This
   simplifies the code a bit and makes it easier to translate
   nested packets like ICMP error messages.

2. Don't hardcode IP source and destination addresses. This is
   required to translate ICMP error messages.

Bug: 8276725
Change-Id: I2cae45683ae3943e508608fd0a140180dbc60823
5 files changed