- /* Copy the transport header */
- if (__get_transport_header_type(skb) == TH_TCP) {
- ctf_align(uint32_t)
- ctf_array_type(uint8_t, tcp_hdr(skb),
- sizeof(struct tcphdr))
+ if (has_network_header) {
+ enum transport_header_types th_type =
+ __get_transport_header_type(skb);
+
+ /* Transport header type field. */
+ ctf_integer_type(unsigned char, th_type)
+
+ /* Copy the transport header. */
+ if (th_type == TH_TCP) {
+ ctf_align(uint32_t)
+ ctf_array_type(uint8_t, tcp_hdr(skb),
+ sizeof(struct tcphdr))
+ }
+ /*
+ * For any other transport header type,
+ * there is nothing to do.
+ */