GetPortsWithStartLimit

Retrieve a list of ports starting from start with up to limit elements, according to the current SDK settings.

int GetPortsWithStartLimit(unsigned int start, unsigned int limit, uint32_t** outPtr, int* outLen)

Parameters

  • start: Starting port.

  • limit: Maximum number of ports to return.

Return Value

  • int: 0 if success.

  • outPtr: Pointer to an array of ports (must be freed with FreeBuf).

  • outLen: Number of ports in outPtr.

Example

// example

uint32_t* out = NULL; 
int n = 0;
GetPortsWithStartLimit(60001, 10, &out, &n);
if (out) {
    for (int i = 0; i < n; i++) {
        printf("Port: %u\n", out[i]);
    }
    FreeBuf(out);
}

Last updated

Was this helpful?