datapath: Fix ovs_vport_cmd_del return value on success
[cascardo/ovs.git] / build-aux / extract-ofp-errors
index efaf103..db28af8 100755 (executable)
@@ -207,7 +207,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(', '):
@@ -234,9 +234,15 @@ def extract_ofp_errors(filenames):
                               "NX1.0+": ("OF1.0", "OF1.1", "OF1.2"),
                               "NX1.0":  ("OF1.0",),
                               "NX1.1":  ("OF1.1",),
+                              "NX1.1+": ("OF1.1",),
                               "NX1.2":  ("OF1.2",)}
                 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_]:
@@ -342,7 +348,7 @@ static enum ofperr
 }"""
 
         print """
-const struct ofperr_domain %s = {
+static const struct ofperr_domain %s = {
     "%s",
     %d,
     %s_decode,