ctypes y pasando un por referencia a una función
Estoy tratando de usar libpcap en python3 usando ctypes.
dada la siguiente función en C
pcap_lookupnet(dev, &net, &mask, errbuf)
en Python tengo el siguiente
pcap_lookupnet = pcap.pcap_lookupnet
mask = ctypes.c_uint32
net = ctypes.c_int32
if(pcap_lookupnet(dev,net,mask,errbuf) == -1):
print("Error could not get netmask for device {0}".format(errbuf))
sys.exit(0)
y el error que obtengo es
File "./libpcap.py", line 63, in <module>
if(pcap_lookupnet(dev,net,mask,errbuf) == -1):
ctypes.ArgumentError: argument 2: <class 'TypeError'>: Don't know how to convert parameter 2
¿Cómo manejas los valores de & bla?