Just cast the entire sockaddr
structure to a sockaddr_in. Then you can use:
char *ip = inet_ntoa(their_addr.sin_addr)
To retrieve the standard ip representation.
More Related Contents:
- How to get ip address from sock structure in c?
- Integer to IP Address – C
- What are the flags and macros in a Makefile? [closed]
- How to share memory between processes created by fork()?
- Fastest way to get IPv4 address from string
- Is an empty initializer list valid C code?
- How does GCC implement variable-length arrays?
- Pointer to a specific fixed address
- What is the full “for” loop syntax in C?
- Is a Recursive-Iterative Method Better than a Purely Iterative Method to find out if a number is prime?
- Build .so file from .c file using gcc command line
- In C, why is sizeof(char) 1, when ‘a’ is an int?
- Is it possible to “jump”/”skip” in GDB debugger?
- Limit a double to two decimal places [duplicate]
- implement time delay in c
- Gaussian elimination without result for acceleration
- Why do I get different results when I dereference a pointer after freeing it?
- Memory usage of current process in C
- What do fully buffered, line buffered and unbuffered mean in C? [closed]
- How to position the input text cursor in C?
- Casting a pointer does not produce an lvalue. Why?
- Writing to stdin and reading from stdout (UNIX/LINUX/C Programming)
- Is there a GCC keyword to allow structure-reordering?
- Is freeing allocated memory needed when exiting a program in C
- Please explain the comma operator in this program
- Unresolved symbols when linking a program using libcurl
- How would you set a variable to the largest number possible in C?
- Valgrind not showing line numbers in spite of -g flag (on Ubuntu 11.10/VirtualBox)
- C11 _Generic: how to deal with string literals?
- Redefining NULL