TNSM_Latency_Prediction / code / control / ingress / 2_custom / ingress_deparser.p4
ingress_deparser.p4
Raw
control IngressDeparser(packet_out packet,
    /* User */
    inout my_ingress_headers_t                       hdr,
    in    my_ingress_metadata_t                      meta,
    /* Intrinsic */
    in    ingress_intrinsic_metadata_for_deparser_t  ig_dprsr_md)
{
    apply {
        packet.emit(hdr.ethernet);
        packet.emit(hdr.ts_ingress);
        packet.emit(hdr.ipv4);
        packet.emit(hdr.ipv6);
        packet.emit(hdr.tcp);
        packet.emit(hdr.udp);
    #ifdef CUSTOM_H1
        packet.emit(hdr.custom1);
    #endif
    #ifdef CUSTOM_H2
        packet.emit(hdr.custom2);
    #endif
    #ifdef CUSTOM_H3
        packet.emit(hdr.custom3);
    #endif
    #ifdef CUSTOM_H4
        packet.emit(hdr.custom4);
    #endif
    #ifdef CHECK
        packet.emit(hdr.check);
    #endif
    }
}