ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
im definetly not going to read all the code, but..
where did you get it? IS there a linux version?
c++ should work and compile on any OS/distro. try it, what are the errors?
when i complie these ae the errors i get.................
do u have any idea how to solve it
cc -D_KERNEL -I/sys -c -o obsd_sraw.o obsd_sraw.c
In file included from obsd_sraw.c:25:
/usr/include/linux/in_systm.h:28: parse error before "n_short"
/usr/include/linux/in_systm.h:29: parse error before "n_long"
/usr/include/linux/in_systm.h:30: parse error before "n_time"
obsd_sraw.c:26:26: net/addrconf.h: No such file or directory
obsd_sraw.c:27:24: linux/zconf.h: No such file or directory
In file included from obsd_sraw.c:28:
/usr/include/linux/autoconf.h:1:2: #error Invalid kernel header included in userspace
obsd_sraw.c:29:22: sys/exec.h: No such file or directory
obsd_sraw.c:30:21: sys/lkm.h: No such file or directory
obsd_sraw.c:31:25: sys/protosw.h: No such file or directory
obsd_sraw.c:33:22: sys/mbuf.h: No such file or directory
In file included from obsd_sraw.c:39:
/usr/include/netinet/in_systm.h:35: `n_short' redeclared as different kind of symbol
/usr/include/linux/in_systm.h:28: previous declaration of `n_short'
/usr/include/netinet/in_systm.h:36: `n_long' redeclared as different kind of symbol
/usr/include/linux/in_systm.h:29: previous declaration of `n_long'
/usr/include/netinet/in_systm.h:37: `n_time' redeclared as different kind of symbol
/usr/include/linux/in_systm.h:30: previous declaration of `n_time'
obsd_sraw.c:41:28: netinet/in_pcb.h: No such file or directory
obsd_sraw.c:45: warning: `struct mbuf' declared inside parameter list
obsd_sraw.c:45: warning: its scope is only this definition or declaration, which is probably not what you want
obsd_sraw.c:45: warning: `struct socket' declared inside parameter list
obsd_sraw.c:49: warning: `struct mbuf' declared inside parameter list
obsd_sraw.c:49: warning: `struct socket' declared inside parameter list
obsd_sraw.c:56: parse error before string constant
obsd_sraw.c:56: warning: data definition has no type or storage class
obsd_sraw.c:59: warning: `struct lkm_table' declared inside parameter list
obsd_sraw.c: In function `SRaw_load':
obsd_sraw.c:61: `LKM_E_LOAD' undeclared (first use in this function)
obsd_sraw.c:61: (Each undeclared identifier is reported only once
obsd_sraw.c:61: for each function it appears in.)
obsd_sraw.c:75: invalid use of undefined type `struct protosw'
obsd_sraw.c:76: invalid use of undefined type `struct protosw'
obsd_sraw.c:77: `IPPROTO_IPV4' undeclared (first use in this function)
obsd_sraw.c:78: invalid use of undefined type `struct protosw'
obsd_sraw.c:79: invalid use of undefined type `struct protosw'
obsd_sraw.c: At top level:
obsd_sraw.c:89: warning: `struct lkm_table' declared inside parameter list
obsd_sraw.c: In function `SRaw_unload':
obsd_sraw.c:91: `LKM_E_UNLOAD' undeclared (first use in this function)
obsd_sraw.c:98: invalid use of undefined type `struct protosw'
obsd_sraw.c:99: invalid use of undefined type `struct protosw'
obsd_sraw.c:100: `IPPROTO_IPV4' undeclared (first use in this function)
obsd_sraw.c:101: invalid use of undefined type `struct protosw'
obsd_sraw.c:102: invalid use of undefined type `struct protosw'
obsd_sraw.c: In function `SRaw':
obsd_sraw.c:116: `lkm_nofunc' undeclared (first use in this function)
obsd_sraw.c: In function `nopriv_rip_usrreq':
obsd_sraw.c:125: argument `so' doesn't match prototype
obsd_sraw.c:45: prototype declaration
obsd_sraw.c:125: argument `m' doesn't match prototype
obsd_sraw.c:45: prototype declaration
obsd_sraw.c:125: argument `nam' doesn't match prototype
obsd_sraw.c:45: prototype declaration
obsd_sraw.c:125: argument `control' doesn't match prototype
obsd_sraw.c:45: prototype declaration
obsd_sraw.c:127: warning: initialization makes pointer from integer without a cast
obsd_sraw.c:131: `PRU_CONTROL' undeclared (first use in this function)
obsd_sraw.c:135: `PRU_ATTACH' undeclared (first use in this function)
obsd_sraw.c:136: `EINVAL' undeclared (first use in this function)
obsd_sraw.c:152: dereferencing pointer to incomplete type
obsd_sraw.c:152: `SS_PRIV' undeclared (first use in this function)
obsd_sraw.c:153: dereferencing pointer to incomplete type
obsd_sraw.c:159: dereferencing pointer to incomplete type
obsd_sraw.c:160: dereferencing pointer to incomplete type
obsd_sraw.c:163: `PRU_DISCONNECT' undeclared (first use in this function)
obsd_sraw.c:164: dereferencing pointer to incomplete type
obsd_sraw.c:164: `SS_ISCONNECTED' undeclared (first use in this function)
obsd_sraw.c:165: `ENOTCONN' undeclared (first use in this function)
obsd_sraw.c:169: `PRU_ABORT' undeclared (first use in this function)
obsd_sraw.c:172: `PRU_DETACH' undeclared (first use in this function)
obsd_sraw.c:182: `PRU_BIND' undeclared (first use in this function)
obsd_sraw.c:184: parse error before "struct"
obsd_sraw.c:186: dereferencing pointer to incomplete type
obsd_sraw.c:190: `ifnet' undeclared (first use in this function)
obsd_sraw.c:192: `AF_IMPLINK' undeclared (first use in this function)
obsd_sraw.c:195: `EADDRNOTAVAIL' undeclared (first use in this function)
obsd_sraw.c:198: dereferencing pointer to incomplete type
obsd_sraw.c:201: `PRU_CONNECT' undeclared (first use in this function)
obsd_sraw.c:203: parse error before "struct"
obsd_sraw.c:205: dereferencing pointer to incomplete type
obsd_sraw.c:215: `EAFNOSUPPORT' undeclared (first use in this function)
obsd_sraw.c:218: dereferencing pointer to incomplete type
obsd_sraw.c:223: `PRU_CONNECT2' undeclared (first use in this function)
obsd_sraw.c:224: `EOPNOTSUPP' undeclared (first use in this function)
obsd_sraw.c:230: `PRU_SHUTDOWN' undeclared (first use in this function)
obsd_sraw.c:238: `PRU_SEND' undeclared (first use in this function)
obsd_sraw.c:242: dereferencing pointer to incomplete type
obsd_sraw.c:244: `EISCONN' undeclared (first use in this function)
obsd_sraw.c:247: dereferencing pointer to incomplete type
obsd_sraw.c:253: parse error before "struct"
obsd_sraw.c:263: `PRU_SENSE' undeclared (first use in this function)
obsd_sraw.c:276: `PRU_SENDOOB' undeclared (first use in this function)
obsd_sraw.c:280: `PRU_SOCKADDR' undeclared (first use in this function)
obsd_sraw.c:284: `PRU_PEERADDR' undeclared (first use in this function)
make: *** [obsd_sraw.o] Error 1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.