def process_forced_header_ordering(hlir, ordering):
    p4_ordering = []
    for hdr_name in ordering:
        if hdr_name in hlir.p4_header_instances:
            p4_ordering.append(hlir.p4_header_instances[hdr_name])
        elif hdr_name + "[0]" in hlir.p4_header_instances:
            hdr_0 = hlir.p4_header_instances[hdr_name + "[0]"]
            for index in xrange(hdr_0.max_index + 1):
                indexed_name = hdr_name + "[" + str(index) + "]"
                p4_ordering.append(hlir.p4_header_instances[indexed_name])
        else:
            return None
    return p4_ordering