Skip to content

Instantly share code, notes, and snippets.

@mwetterw
mwetterw / get_tos_ipv6_tcp.c
Last active March 9, 2016 16:09
POC to see if incoming packet TOS can be retrieved from userspace with TCP/IPv6 (without use of raw or UDP).
#include <stdio.h> // printf
#include <stdlib.h> // EXIT_SUCCESS
#include <string.h> // memset
#include <sys/types.h> // size_t
#include <sys/socket.h> // recvmsg, msghdr, cmsghdr
#include <netdb.h> // struct addrinfo
#include <arpa/inet.h> // inet_ntop
#include <netinet/in.h> // sockaddr_in