How to properly translate IP in form of string like "192.168.1.0" to 32bit integer ?
What is the best function - it will be used for socket IPv4 address.
I found some info on inet_addr() and inet_pton() but when I tried to use them they show error:
error: implicit declaration of function 'inet_addr' [-Werror=implicit-function-declaration]
I could just shift bytes myself but not sure what is the layouts of bits for socket address word.
Thanks for help
Convert string IP address to integer
-
- Posts: 47
- Joined: Thu Dec 20, 2018 9:47 am
Re: Convert string IP address to integer
for inet_addr add:
Code: Select all
#include "lwip/inet.h"
Re: Convert string IP address to integer
Works good. Thanks
Now I get some strange warnings
Now I get some strange warnings
I (6165) wpa: PTK has been installed, it may be an attack, ignor it.
I (6165) wpa: GTK has been installed, it may be an attack, ignor it.
-
- Posts: 47
- Joined: Thu Dec 20, 2018 9:47 am
Re: Convert string IP address to integer
The capital "I" at the start of the message indicates that it's an information message rather than a warning,
Who is online
Users browsing this forum: MicroController and 124 guests