sockex3_user.c (3eb66e91a25497065c5322b1268cbc3953642227) sockex3_user.c (5c3cf87d477a461274452cb46f7654c5b6ae6294)
1// SPDX-License-Identifier: GPL-2.0
2#include <stdio.h>
3#include <assert.h>
4#include <linux/bpf.h>
5#include <bpf/bpf.h>
6#include "bpf_load.h"
7#include "sock_example.h"
8#include <unistd.h>

--- 44 unchanged lines hidden (view full) ---

53 assert(id == info.id);
54
55 sock = open_raw_sock("lo");
56
57 assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd[4],
58 sizeof(__u32)) == 0);
59
60 if (argc > 1)
1// SPDX-License-Identifier: GPL-2.0
2#include <stdio.h>
3#include <assert.h>
4#include <linux/bpf.h>
5#include <bpf/bpf.h>
6#include "bpf_load.h"
7#include "sock_example.h"
8#include <unistd.h>

--- 44 unchanged lines hidden (view full) ---

53 assert(id == info.id);
54
55 sock = open_raw_sock("lo");
56
57 assert(setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &prog_fd[4],
58 sizeof(__u32)) == 0);
59
60 if (argc > 1)
61 f = popen("ping -c5 localhost", "r");
61 f = popen("ping -4 -c5 localhost", "r");
62 else
63 f = popen("netperf -l 4 localhost", "r");
64 (void) f;
65
66 for (i = 0; i < 5; i++) {
67 struct flow_key_record key = {}, next_key;
68 struct pair value;
69

--- 15 unchanged lines hidden ---
62 else
63 f = popen("netperf -l 4 localhost", "r");
64 (void) f;
65
66 for (i = 0; i < 5; i++) {
67 struct flow_key_record key = {}, next_key;
68 struct pair value;
69

--- 15 unchanged lines hidden ---