code: def h2i(self, pkt, x):
          
  
          if isinstance(x, str) and x.startswith("v") and len(x) <= 8:
              major = int(x.split(".")[0][1:])
              minor = int(x.split(".")[1])
  
              return (major << 8) | minor
  
          elif isinstance(x, int) and 0 <= x <= 65535:
              return x
          else:
              if not hasattr(self, "default"):
                  return x
              if self.default is not None:
                  warning("set value to default. Format of %r is invalid" % x)
                  return self.default
              else:
                  raise Scapy_Exception("Format of value is invalid")
docs: The field accepts string values like v12.1, v1.1 or integer values.
             String values have to start with a "v" folled by a floating point number.
             Valid numbers are between 0 and 255.