Hi,
How can I get interface index when enumerating interfaces using GetOpt with socket option KSoInetNextInterface?
The option fills in a TSoInetInterfaceInfo structure, but it doesn't contain interface index (a piece of information that I need).
Alternatively, how can I find interface index at all, using any piece of information (like interface IP address)? I tried GetOpt(KSoInetIfQueryByIndex, KSolInetIfQuery, ...), but it returns -5 (KErrNotSupported).Code:User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl)); TPckgBuf<TSoInetInterfaceInfo> iface; while(sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, iface) == KErrNone) { // ... }
Code:RSocket sock; User::LeaveIfError(sock.Open(serv, KAfInet, KSockDatagram, KProtocolInetUdp)); //... TPckgBuf<TSoInetIfQuery> ifq; ifq().iSrcAddr = someIPAddress; // this leaves with -5 User::LeaveIfError(sock.GetOpt(KSoInetIfQueryBySrcAddr, KSolInetIfQuery, ifq));



