This code all comes from contrib/xbow. It is needed to support the xbow's xnp application
