You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the =parse_ethhdr= function from the [[file:../common/parsing_helpers.h][parsing_helpers.h]] file.
23
+
24
+
*** Assignment 2: Parsing the IP header
25
+
26
+
See the =parse_ip6hdr= function from the [[file:../common/parsing_helpers.h][parsing_helpers.h]] file.
27
+
28
+
*** Assignment 3: Parsing the ICMPv6 header and reacting to it
29
+
30
+
See the =parse_icmp6hdr= function from the [[file:../common/parsing_helpers.h][parsing_helpers.h]]
31
+
file. The sequence number should be accessed as =bpf_ntohs(icmp6h->icmp6_sequence)=
32
+
as it is a 2-byte value in the network order.
33
+
34
+
*** Assignment 4: Adding VLAN support
35
+
36
+
See the =parse_ethhdr= function from the [[file:../common/parsing_helpers.h][parsing_helpers.h]] file.
37
+
38
+
*** Assignment 5: Adding IPv4 support
39
+
40
+
See the =parse_iphdr= and =parse_icmphdr= functions from the [[file:../common/parsing_helpers.h][parsing_helpers.h]] file.
41
+
42
+
** Packet02: packet rewriting
43
+
44
+
*** Assignment 1: Rewrite port numbers
45
+
46
+
An example XDP program can be found in the =xdp_patch_ports= section in the [[file:xdp_prog_kern_02.c][xdp_prog_kern_02.c]] file. The program will decrease by one destination port number in any TCP or UDP packet.
47
+
48
+
*** Assignment 2: Remove the outermost VLAN tag
49
+
50
+
See the =vlan_tag_pop= function from the [[file:../common/rewrite_helpers.h][rewrite_helpers.h]] file.
51
+
An example XDP program can be found in the =xdp_vlan_swap= section in the [[file:xdp_prog_kern_02.c][xdp_prog_kern_02.c]] file.
52
+
53
+
*** Assignment 3: Add back a missing VLAN tag
54
+
55
+
See the =vlan_tag_push= function from the [[file:../common/rewrite_helpers.h][rewrite_helpers.h]] file.
56
+
An example XDP program can be found in the =xdp_vlan_swap= section in the [[file:xdp_prog_kern_02.c][xdp_prog_kern_02.c]] file.
57
+
58
+
** Packet03: redirecting packets
59
+
60
+
*** Assignment 1: Send packets back where they came from
61
+
62
+
See the =xdp_icmp_echo= program in the [[file:xdp_prog_kern_03.c][xdp_prog_kern_03.c]] file.
63
+
64
+
*** Assignment 2: Redirect packets between two interfaces
65
+
66
+
See the =xdp_redirect= program in the [[file:xdp_prog_kern_03.c][xdp_prog_kern_03.c]] file.
67
+
68
+
*** Assignment 3: Extend to a bidirectional router
69
+
70
+
See the =xdp_redirect_map= program in the [[file:xdp_prog_kern_03.c][xdp_prog_kern_03.c]] file.
71
+
Userspace part of the assignment is implemented in the [[file:xdp_prog_user.c][xdp_prog_user.c]] file.
72
+
73
+
*** Assignment 4: Use the BPF helper for routing
74
+
75
+
See the =xdp_router= program in the [[file:xdp_prog_kern_03.c][xdp_prog_kern_03.c]] file.
76
+
Userspace part of the assignment is implemented in the [[file:xdp_prog_user.c][xdp_prog_user.c]] file.
0 commit comments