blob: 35552beb557cf850997ba8abe808fb3454c9fee0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/ruby -w
open("include/libnet/libnet-structures.h").each do |line|
#p line
next unless line =~ /^#define (LIBNET_PBLOCK_)(\S+).*/
#p [$1, $2]
type = $1+$2
name = $2.sub(/_H$/, "").downcase.inspect
next if type == "LIBNET_PBLOCK_DO_CHECKSUM"
puts " case #{type}:"
puts " return (#{name});"
end
|