Lines Matching full:f
32 def print_header(f): argument
33 f.write("// SPDX-License-Identifier: GPL-2.0\n")
34 f.write("/* DO NOT EDIT -- this file is generated */\n")
35 f.write("\n")
36 f.write("#ifndef _IP_CHECK_DEFRAG_FRAGS_H\n")
37 f.write("#define _IP_CHECK_DEFRAG_FRAGS_H\n")
38 f.write("\n")
39 f.write("#include <stdint.h>\n")
40 f.write("\n")
43 def print_frags(f, frags, v6): argument
50 f.write(f"static uint8_t frag{suffix}_{idx}[] = {{\n")
52 f.write(f"\t{chunk},\n")
53 f.write(f"}};\n")
56 def print_trailer(f): argument
57 f.write("\n")
58 f.write("#endif /* _IP_CHECK_DEFRAG_FRAGS_H */\n")
61 def main(f): argument
77 frags = [f.build() for f in pkt.fragment(24)]
78 frags6 = [f.build() for f in fragment6(pkt6, 72)]
80 print_header(f)
81 print_frags(f, frags, False)
82 print_frags(f, frags6, True)
83 print_trailer(f)
88 header = f"{dir}/ip_check_defrag_frags.h"
89 with open(header, "w") as f:
90 main(f)