I ended up making sizable changes to the "addr" implementation (and
addr_iter with it). The rest of the SWIG file is pretty much the same,
except for the places where it references struct addrs.
The main change is that instead of using the SWIG_pointer
mechanism and a shadow class, 'addr' is actually a native Python
class, and the typemaps translate between the native class and the
struct when needed. This works very well for my purposes. (I also
think it's simpler.) I tried to retain all the behaviors of the old
implementation but I may have missed something.
There are two files here: a patch for dnet.i, and a new file addr.i
(which I split into its own file for my own convenience; there's no
reason it couldn't be inlined again.)
Log in to post a comment.