asn2c
来自「netflow,抓包」· 代码 · 共 43 行
TXT
43 行
#!/usr/local/bin/perl## converts internic netinfo/asn.txt to C code#print '#include "bytes.h"#include "sym.h"#include "fmt.h"struct sym_table sym_asn[] = { ';while (<>) { chop; next if (!/^ *\d+/); $_ =~ s/^ +//g; @f = split; next if ($f[0] =~ /^32768|64512/); if ($f[1] eq '-') { for ($asn = $f[0]; $asn <= $f[2]; ++$asn) { print "{\"$f[3]\", $asn},\n"; } } else { print "{\"$f[1]\", $f[0]},\n"; }}print ' {(char*)0L, 0},};'
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?