Hi,
I see that the result of CONFD_GET_IPV4(setVal); is in_addr paprameter.
How can I convert it to integer?
It is a struct, could not find its description in the manual.
Regards
Inbal
Hi,
I see that the result of CONFD_GET_IPV4(setVal); is in_addr paprameter.
How can I convert it to integer?
It is a struct, could not find its description in the manual.
Regards
Inbal
in_addr is used for socket programming and is defined as part of the GNU C library, in netinet/in.h. For your convenience, it is defined as follows:
typedef uint32_t in_addr_t;
struct in_addr {
in_addr_t s_addr;
};
Thanks for your reply.
So if I want to convert the ipv4_address to integer:
in_addr ipv4_addr = CONFD_GET_IPV4(val);
integer int_addr = ipv4_addr.s_addr;
Is that correct?
Hi Inbal,
Probably correct.
It depends on what type your “integer” is. s_addr is of type in_addr_t which is uint32_t (32-bit unsigned integer).