stevens writes:
> Can I put net_look_impl to main function?Like this:
> int main(int argc, char** argv) {
>     net_data_t ipv4=net_lookup_impl(NHF_INET,NULL);
>     return (EXIT_SUCCESS);
> }

I can't tell what you're trying to do here.  main() isn't specified
for kernel loadable modules.  Have you read the _init(9E) man page?

Are you trying to build a kernel module or something else?  If you're
trying to build a user space program, then main() is a good starting
point, but none of the kernel functions will be available.  You
probably want something else (sockets, perhaps) for I/O.

> And I compiled 
> $cc -D_KERNEL -lnsl -lsocket -c hook_test.c

You cannot link against libnsl or libsocket in the kernel.  Libraries
don't exist in the kernel.

Do you want to create a kernel module or a user space program?

> $ld -dy -Nmisc/neti -o hook_test hook_test.o
> Undefined                       first referenced
>  symbol                             in file
> net_lookup_impl                     hook_test.o
> ld: fatal: Symbol referencing errors. No output written to hook_test

You need "-r" to produce a relocatable module for use in the kernel.

Here's a good starting point:

  http://docs.sun.com/app/docs/doc/816-4854

-- 
James Carlson, Solaris Networking              <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive        71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to