def serializeFieldEmit(self, serializer, name, index,
                           field, alignment, program):
        assert isinstance(index, str)
        assert isinstance(name, str)
        assert isinstance(field, ebpfStructType.EbpfField)
        assert isinstance(serializer, ProgramSerializer)
        assert isinstance(alignment, int)
        assert isinstance(program, ebpfProgram.EbpfProgram)

        if field.name == "valid":
            return

        fieldToEmit = (program.headerStructName + "." + name +
                       index + "." + field.name)
        width = field.widthInBits()
        if width <= 32:
            store = self.generatePacketStore(fieldToEmit, 0, alignment,
                                             width, program)
            serializer.emitIndent()
            serializer.appendLine(store)
        else:
            # Destination is bigger than 4 bytes and
            # represented as a byte array.
            b = (width + 7) / 8
            for i in range(0, b):
                serializer.emitIndent()
                store = self.generatePacketStore(fieldToEmit + "["+str(i)+"]",
                                                 i,
                                                 alignment,
                                                 8, program)
                serializer.appendLine(store)

        serializer.emitIndent()
        serializer.appendFormat("{0} += {1};",
                                program.offsetVariableName, width)
        serializer.newline()
dataset/ETHPy150Open iovisor/bcc/src/cc/frontends/p4/compiler/ebpfDeparser.py/EbpfDeparser.serializeFieldEmit/original