GetPortsAvailable
Filter the input array and return only ports that are currently available.
int GetPortsAvailable(unsigned int* ports, int portsLen, unsigned int** outArr, int* outLen)
Parameters
ports: Input array of ports.
portsLen: Number of elements in ports.
Return Value
int: 0 on success.
outArr: Output pointer; receives an allocated array of available ports (free with FreeBuf).
outLen: Output count; number of elements in outArr.
Example
// example
unsigned inPorts[]={60000,60001,60002};
unsigned* out=NULL; int n=0;
GetPortsAvailable(inPorts,3,&out,&n);
if (out){ FreeBuf(out);}
Last updated
Was this helpful?