X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=build-aux%2Fextract-ofp-errors;h=c3273041404ca8c1a8b650f81168b6703a947781;hb=2e1ae2005ed347d2dfebd23fff40c54a1a2a6716;hp=1ec5ba4d39ce654372e13fe15a3d220bfa703f41;hpb=d01c980ffe0d61497298a9f907ff93fe1751e2bd;p=openvswitch diff --git a/build-aux/extract-ofp-errors b/build-aux/extract-ofp-errors index 1ec5ba4d..c3273041 100755 --- a/build-aux/extract-ofp-errors +++ b/build-aux/extract-ofp-errors @@ -151,7 +151,8 @@ def extract_ofp_errors(filenames): names = [] domain = {} reverse = {} - for domain_name in ("OF1.0", "OF1.1", "OF1.2", "NX1.0", "NX1.1"): + for domain_name in ("OF1.0", "OF1.1", "OF1.2", "OF1.3", + "NX1.0", "NX1.1", "NX1.2", "NX1.3"): domain[domain_name] = {} reverse[domain_name] = {} @@ -207,7 +208,7 @@ def extract_ofp_errors(filenames): enum = m.group(1) - comments.append(comment) + comments.append(re.sub('\[[^]]*\]', '', comment)) names.append(enum) for dst in dsts.split(', '): @@ -225,19 +226,29 @@ def extract_ofp_errors(filenames): else: code = None - target_map = {"OF1.0+": ("OF1.0", "OF1.1", "OF1.2"), - "OF1.1+": ("OF1.1", "OF1.2"), - "OF1.2+": ("OF1.2",), + target_map = {"OF1.0+": ("OF1.0", "OF1.1", "OF1.2", "OF1.3"), + "OF1.1+": ("OF1.1", "OF1.2", "OF1.3"), + "OF1.2+": ("OF1.2", "OF1.3"), + "OF1.3+": ("OF1.3",), "OF1.0": ("OF1.0",), "OF1.1": ("OF1.1",), "OF1.2": ("OF1.2",), - "NX1.0+": ("OF1.0", "OF1.1", "OF1.2"), + "OF1.3": ("OF1.3",), + "NX1.0+": ("OF1.0", "OF1.1", "OF1.2", "OF1.3"), + "NX1.1+": ("OF1.1", "OF1.2", "OF1.3"), + "NX1.2+": ("OF1.2", "OF1.3"), + "NX1.3+": ("OF1.3",), "NX1.0": ("OF1.0",), "NX1.1": ("OF1.1",), - "NX1.1+": ("OF1.1",), - "NX1.2": ("OF1.2",)} + "NX1.2": ("OF1.2",), + "NX1.3": ("OF1.3",)} if targets not in target_map: fatal("%s: unknown error domain" % targets) + if targets.startswith('NX') and code < 0x100: + fatal("%s: NX domain code cannot be less than 0x100" % dst) + if targets.startswith('OF') and code >= 0x100: + fatal("%s: OF domain code cannot be greater than 0x100" + % dst) for target in target_map[targets]: domain[target].setdefault(type_, {}) if code in domain[target][type_]: @@ -343,7 +354,7 @@ static enum ofperr }""" print """ -const struct ofperr_domain %s = { +static const struct ofperr_domain %s = { "%s", %d, %s_decode, @@ -364,6 +375,7 @@ const struct ofperr_domain %s = { output_domain(reverse["OF1.0"], "ofperr_of10", "OpenFlow 1.0", 0x01) output_domain(reverse["OF1.1"], "ofperr_of11", "OpenFlow 1.1", 0x02) output_domain(reverse["OF1.2"], "ofperr_of12", "OpenFlow 1.2", 0x03) + output_domain(reverse["OF1.3"], "ofperr_of13", "OpenFlow 1.3", 0x04) if __name__ == '__main__': if '--help' in sys.argv: