Code Monkey home page Code Monkey logo

Comments (13)

martinorob avatar martinorob commented on May 22, 2024 2

@JohnDDuncanIII may you explain how do you do it? Thanks

from icmptunnel.

green4984 avatar green4984 commented on May 22, 2024 2

struct iphdr not exists on MacOS, use the define code below

#ifdef APPLE
#define iphdr ip
#endif

from icmptunnel.

qq42 avatar qq42 commented on May 22, 2024 1

@martinorob An alternative ICMP tunnel implementation with a working OS X client is Hans:
http://code.gerade.org/hans/
https://github.com/friedrich/hans

from icmptunnel.

DhavalKapil avatar DhavalKapil commented on May 22, 2024

The issue is probably with some header file. Presently it works fine on linux. Will look into it in some time

from icmptunnel.

JohnDDuncanIII avatar JohnDDuncanIII commented on May 22, 2024

For what it's worth, I also tried compiling this with gcc47 (sourced from pkg-src and installed on OS X 10.11.2) instead of clang and it still exited with errors

gcc -c -o icmptunnel.o icmptunnel.c -I.
gcc -c -o icmp.o icmp.c -I.
icmp.c:22:47: warning: 'struct icmphdr' declared inside parameter list [enabled by default]
icmp.c:22:47: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
icmp.c:22:47: warning: 'struct iphdr' declared inside parameter list [enabled by default]
icmp.c: In function 'send_icmp_packet':
icmp.c:103:24: error: invalid application of 'sizeof' to incomplete type 'struct iphdr'
icmp.c:103:47: error: invalid application of 'sizeof' to incomplete type 'struct icmphdr'
icmp.c:114:45: error: invalid application of 'sizeof' to incomplete type 'struct iphdr'
icmp.c:115:43: error: invalid application of 'sizeof' to incomplete type 'struct iphdr'
icmp.c:115:66: error: invalid application of 'sizeof' to incomplete type 'struct icmphdr'
icmp.c:117:3: warning: passing argument 1 of 'prepare_headers' from incompatible pointer type [enabled by default]
icmp.c:22:6: note: expected 'struct iphdr *' but argument is of type 'struct iphdr *'
icmp.c:117:3: warning: passing argument 2 of 'prepare_headers' from incompatible pointer type [enabled by default]
icmp.c:22:6: note: expected 'struct icmphdr *' but argument is of type 'struct icmphdr *'
icmp.c:119:5: error: dereferencing pointer to incomplete type
icmp.c:120:5: error: dereferencing pointer to incomplete type
icmp.c:121:5: error: dereferencing pointer to incomplete type
icmp.c:125:7: error: dereferencing pointer to incomplete type
icmp.c:126:7: error: dereferencing pointer to incomplete type
icmp.c:127:7: error: dereferencing pointer to incomplete type
icmp.c:127:60: error: invalid application of 'sizeof' to incomplete type 'struct icmphdr'
icmp.c: In function 'receive_icmp_packet':
icmp.c:165:45: error: invalid application of 'sizeof' to incomplete type 'struct iphdr'
icmp.c:166:43: error: invalid application of 'sizeof' to incomplete type 'struct iphdr'
icmp.c:166:66: error: invalid application of 'sizeof' to incomplete type 'struct icmphdr'
icmp.c:169:26: error: dereferencing pointer to incomplete type
icmp.c:170:26: error: dereferencing pointer to incomplete type
icmp.c:171:30: error: dereferencing pointer to incomplete type
icmp.c:172:55: error: invalid application of 'sizeof' to incomplete type 'struct iphdr'
icmp.c:172:78: error: invalid application of 'sizeof' to incomplete type 'struct icmphdr'
icmp.c: At top level:
icmp.c:220:47: warning: 'struct icmphdr' declared inside parameter list [enabled by default]
icmp.c:220:47: warning: 'struct iphdr' declared inside parameter list [enabled by default]
icmp.c:220:6: error: conflicting types for 'prepare_headers'
icmp.c:22:6: note: previous declaration of 'prepare_headers' was here
icmp.c: In function 'prepare_headers':
icmp.c:222:5: error: dereferencing pointer to incomplete type
icmp.c:223:5: error: dereferencing pointer to incomplete type
icmp.c:224:5: error: dereferencing pointer to incomplete type
icmp.c:225:5: error: dereferencing pointer to incomplete type
icmp.c:226:5: error: dereferencing pointer to incomplete type
icmp.c:227:5: error: dereferencing pointer to incomplete type
icmp.c:228:5: error: dereferencing pointer to incomplete type
icmp.c:230:7: error: dereferencing pointer to incomplete type
icmp.c:231:7: error: dereferencing pointer to incomplete type
icmp.c:232:7: error: dereferencing pointer to incomplete type
icmp.c:233:7: error: dereferencing pointer to incomplete type
make: *** [icmp.o] Error 1

running echo $? reveals that it exited with code 2. gcc version used is version 4.7.4 built and installed yesterday.

from icmptunnel.

DhavalKapil avatar DhavalKapil commented on May 22, 2024

Perhapsstruct iphdr is defined differently/not defined in OS X. I'll have to define it myself.

I'm still searching for other solutions though.

from icmptunnel.

dotpot avatar dotpot commented on May 22, 2024

👍

from icmptunnel.

JohnDDuncanIII avatar JohnDDuncanIII commented on May 22, 2024

Yeah, I tried declaring the structs manually in the icmp.c file [struct iphdr{stuff}; , etc], which fixed the 'incomplete type' issues. I do agree that there is probably a more portable solution to the problem though.

from icmptunnel.

prologic avatar prologic commented on May 22, 2024

Any updates on this?

from icmptunnel.

DhavalKapil avatar DhavalKapil commented on May 22, 2024

Not yet.

from icmptunnel.

BruceLEO1969 avatar BruceLEO1969 commented on May 22, 2024

Got the same issues

from icmptunnel.

BirkhoffLee avatar BirkhoffLee commented on May 22, 2024

Same here

from icmptunnel.

leonardoarroyo avatar leonardoarroyo commented on May 22, 2024

I'm having the same.

from icmptunnel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.