Created
March 31, 2015 13:20
-
-
Save polc/b3d12a24385244d86b2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct IPv4Header | |
{ | |
u_int8_t versionAndHeaderLength; | |
u_int8_t differentiatedServices; | |
u_int16_t totalLength; | |
u_int16_t identification; | |
u_int16_t fragmentOffset; | |
u_int8_t timeToLive; | |
u_int8_t protocol; | |
u_int16_t checksum; | |
struct in_addr source, destination; | |
} IPv4Header; | |
uint8_t buffer[HeaderSize]; | |
mHeader = *((IPv4Header*) buffer); // uint8_t to IPv4Header | |
*((IPv4Header*) buffer) = mHeader; // IPv4Header to uint8_t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment