diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-10-10 02:31:11 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2011-10-10 02:31:11 +0000 |
commit | cf012d27b10930edc93ca0e44d2a38e69200169f (patch) | |
tree | 0c80b13c452cecb6bab14694c1bebf8e49a740a5 /tools | |
parent | 6142dd287bb03011ee572d01bcf903c81523fd0c (diff) |
Build the ASN.1 dissectors directly into epan/dissectors (rather than building
them and then copying them over). The "all" target to builds these dissectors
now (instead of "generate_files" and/or "copy_files").
asn2wrs's "-O" option now means "the dissector goes in this directory" (rather
than "all output goes in this directory"); it also means that the "-s" (single
output file) option is now required.
Fix things up so that it's possible to build all of the ASN.1 dissectors in
one shot.
Fix building of conformance files when doing out-of-source-tree builds.
Unfortunately "make all" in the asn1 directory always builds something--I think
because of circular depedencies.
svn path=/trunk/; revision=39333
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/asn2wrs.py | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py index 0d3f2fa6bd..18fe4d12bf 100755 --- a/tools/asn2wrs.py +++ b/tools/asn2wrs.py @@ -567,8 +567,8 @@ def rel_dissector_path(filename): path_parts.pop(0) path_parts.insert(0, '..') path_parts.insert(0, '..') - return '/'.join(path_parts) - + return '/'.join(path_parts) + #--- EthCtx ------------------------------------------------------------------- class EthCtx: @@ -1394,7 +1394,7 @@ class EthCtx: out += ' { %3s, "%s" },\n' % (vval, id) out += " { 0, NULL }\n};\n" if (use_ext): - out += "\nstatic value_string_ext %s_ext = VALUE_STRING_EXT_INIT(%s);\n" % (self.eth_vals_nm(tname), self.eth_vals_nm(tname)) + out += "\nstatic value_string_ext %s_ext = VALUE_STRING_EXT_INIT(%s);\n" % (self.eth_vals_nm(tname), self.eth_vals_nm(tname)) return out #--- eth_enum_prefix ------------------------------------------------------------ @@ -2817,12 +2817,9 @@ class EthOut: fn += '-' + ftype fn += '.' + ext return fn - #--- output_fullname ------------------------------------------------------- - def output_fullname(self, ftype, ext='c'): - return os.path.join(self.outdir, self.output_fname(ftype, ext=ext)) #--- file_open ------------------------------------------------------- def file_open(self, ftype, ext='c'): - fn = self.output_fullname(ftype, ext=ext) + fn = self.output_fname(ftype, ext=ext) if self.created_file_exists(fn): fx = file(fn, 'a') else: @@ -2877,11 +2874,11 @@ class EthOut: def make_single_file(self): if (not self.single_file): return in_nm = self.single_file + '.c' - out_nm = self.output_fullname('') + out_nm = os.path.join(self.outdir, self.output_fname('')) self.do_include(out_nm, in_nm) in_nm = self.single_file + '.h' if (os.path.exists(in_nm)): - out_nm = self.output_fullname('', ext='h') + out_nm = os.path.join(self.outdir, self.output_fname('', ext='h')) self.do_include(out_nm, in_nm) if (not self.keep): for fn in self.created_files_ord: @@ -3938,7 +3935,7 @@ class SeqType (SqType): if isinstance(e.val, ExtensionAdditionGroup): e.val.parent_ident = ident e.val.parent_tname = ectx.type[ident]['tname'] - if (e.val.ver): + if (e.val.ver): e.val.SetName("eag_v%s" % (e.val.ver)) else: e.val.SetName("eag_%d" % (eag_num)) @@ -7765,7 +7762,7 @@ asn2wrs [-h|?] [-d dbg] [-b] [-p proto] [-c cnf_file] [-e] input_file(s) ... -p proto : Protocol name (implies -S). Default is module-name from input_file (renamed by #.MODULE if present) -o name : Output files name core (default is <proto>) - -O dir : Output directory + -O dir : Output directory for dissector -c cnf_file : Conformance file -I path : Path for conformance file includes -e : Create conformance file for exported types @@ -7778,7 +7775,7 @@ asn2wrs [-h|?] [-d dbg] [-b] [-p proto] [-c cnf_file] [-e] input_file(s) ... -D dir : Directory for input_file(s) (default: '.') -C : Add check for SIZE constraints -r prefix : Remove the prefix from type names - + input_file(s) : Input ASN.1 file(s) -d dbg : Debug output, dbg = [l][y][p][s][a][t][c][m][o] |