Date: Thu, 13 Aug 2009 23:29:19 -0400 From: bert wiley <bertwiley@gmail.com> To: freebsd-hackers@freebsd.org Subject: Need help trying to to use the ntohl() call with in_addr Message-ID: <9527461a0908132029xb2c6149r9f51c775d22ae670@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Hi everyone Im new to list and this question may be out of place. This is my first post. Im new to freebsd and trying to understand how to create a jail from some system calls. I followed the jail subsystem description from the handbook and im having a problem or may be using the call incorrectly. But here is what im trying to do. int main() { struct in_addr ipaddr; struct jail myjail; char path[PATH_MAX]; realpath("/tmp", path); myjail.version = 1; myjail.path = path; myjail.hostname = "testjail"; const char *ip; ip = "192.168.1.142"; inet_aton(ip, &ipaddr); myjail.ip4 = ntohl(ipaddr.s_addr); // I get and error here, invalid conversion from _uint32_t' to in_addr* myjail.ip4 = ipaddr.s_addr; // and and error here, invlid conversion from in_addr_t to in_addr* } I know that there is more that needs to be done but this just a test stub as im trying to work thru the calls and understand whats going on. Any would be appreciated thanks.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9527461a0908132029xb2c6149r9f51c775d22ae670>