ctypes e passando a por referência a uma função
Estou tentando usar a libpcap em python3 usando ctype
deu a seguinte função em C
pcap_lookupnet(dev, &net, &mask, errbuf)
em python, tenho o seguinte
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)
e o erro que recebo é
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
Como você lida com os valores & blá?