Skip to content

Commit ee16fbd

Browse files
authored
More comments filed in basic.p4 for ivp4_forward and MyDeparser (#572)
1 parent 0a61e35 commit ee16fbd

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

Diff for: exercises/basic/basic.p4

+26-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ control MyIngress(inout headers hdr,
7979
}
8080

8181
action ipv4_forward(macAddr_t dstAddr, egressSpec_t port) {
82-
/* TODO: fill out code in action body */
82+
/*
83+
Action function for forwarding IPv4 packets.
84+
85+
This function is responsible for forwarding IPv4 packets to the specified
86+
destination MAC address and egress port.
87+
88+
Parameters:
89+
- dstAddr: Destination MAC address of the packet.
90+
- port: Egress port where the packet should be forwarded.
91+
92+
TODO: Implement the logic for forwarding the IPv4 packet based on the
93+
destination MAC address and egress port.
94+
*/
8395
}
8496

8597
table ipv4_lpm {
@@ -144,7 +156,19 @@ control MyComputeChecksum(inout headers hdr, inout metadata meta) {
144156

145157
control MyDeparser(packet_out packet, in headers hdr) {
146158
apply {
147-
/* TODO: add deparser logic */
159+
/*
160+
Control function for deparser.
161+
162+
This function is responsible for constructing the output packet by appending
163+
headers to it based on the input headers.
164+
165+
Parameters:
166+
- packet: Output packet to be constructed.
167+
- hdr: Input headers to be added to the output packet.
168+
169+
TODO: Implement the logic for constructing the output packet by appending
170+
headers based on the input headers.
171+
*/
148172
}
149173
}
150174

0 commit comments

Comments
 (0)