Skip to content

Instantly share code, notes, and snippets.

@nzhang-zh
nzhang-zh / bpf-demo-udp-cli.c
Created August 25, 2018 05:22
Demo of blocking udp data transfer with BPF on linux
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <arpa/inet.h>
int main(){
// open a udp socket