I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
Hey! I saw this has been indexed by the search engines. It is a first draft of a post I ended up publishing on my blog at: Scaling PostgreSQL With Pgpool and PgBouncer
Thanks for stopping by!
This file contains hidden or 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
| uint16_t udp_checksum(struct udphdr *p_udp_header, size_t len, uint32_t src_addr, uint32_t dest_addr) | |
| { | |
| const uint16_t *buf = (const uint16_t*)p_udp_header; | |
| uint16_t *ip_src = (void*)&src_addr, *ip_dst = (void*)&dest_addr; | |
| uint32_t sum; | |
| size_t length = len; | |
| // Calculate the sum | |
| sum = 0; | |
| while (len > 1) |
NewerOlder