Background:
This is a C code for Linux question, so do not run when you see a different language plz.
I am working in the LabVIEW environment on a sbRIO running Linux.
I am trying to program IPv6 communication using C code for Linux.
Question:
The problem that I am currently having is finding the correct
integers not constants to put into the various commands socket, bind etc... All of the examples on the web show constants instead of the actual integer value which I need.
How/where can I find these integer values?
What I Tried:
I thought it might be in the header file, so I downloaded Cygwin and searched it for
socket.h. I found it.
After reading through
socket.h from my Cygwin directory, I managed to find the numeric value for
AF_INET6. Using the int
socket(int domain, int type, int protocol) gives me an error if I use:
domain = 23; // AF_INET6
type = 1; // SOCK_STREAM
protocol = 0; // DEFAULT
however, it works if I use:
domain = 10; // AF_CCITT
type = 1; // SOCK_STREAM
protocol = 0; // DEFAULT
Reference:
http://man7.org/linux/man-pages/man2/socket.2.html
So how/where can I find these integer values and why is it not working when I put in the integer value for AF_INET6? Do different compilers/versions of Linux have different header files?
Thanks.