How to get an IP address from network interfaces

dangbinghoo dangbinghoo at gmail.com
Fri Apr 22 05:33:05 UTC 2022


On Friday, 22 April 2022 at 05:28:52 UTC, dangbinghoo wrote:
> On Thursday, 21 April 2022 at 07:38:04 UTC, Alexander Zhirov 
> wrote:
>> [...]
>
>     ```d
>     struct ifreq {
>     	private union ifr_ifrn_ {
>     		char[IFNAMSIZ] ifrn_name; /* if name, e.g. "en0" */	
>     	}
>     	ifr_ifrn_ ifr_ifrn;
>
> [...]

it's actually POSIX C API binding for D. you should get similar 
code in C when searching StackOverflow.

the only thing to do this is just to look at  /usr/include/dlang 
for POSIX API already complete binding from the official. if 
something is missing, you just do-it-yourself in your code.



More information about the Digitalmars-d-learn mailing list