Git Product home page Git Product logo

udp-broadcast-relay's Issues

Unable to compile on CentOS 7

When trying to compile on CentOS 7 I receive the following output:

[root@TURMERIC udp-broadcast-relay]# make
c99   -Wall main.c -o udp-broadcast-relay
main.c:64:1: error: unknown type name ‘u_char’
 static u_char gram[4096] = {
 ^
main.c: In function ‘main’:
main.c:80:2: error: unknown type name ‘u_char’
  u_char id;
  ^
main.c:81:2: error: unknown type name ‘u_char’
  u_char ttl;
  ^
main.c:100:2: error: unknown type name ‘u_char’
  u_char pkt_infos[16384];
  ^
main.c:235:3: warning: implicit declaration of function ‘bcopy’ [-Wimplicit-function-declaration]
   bcopy((struct sockaddr_in *) &reqbuf.ifr_addr,
   ^
main.c:316:4: error: ‘u_short’ undeclared (first use in this function)
  *(u_short*)(gram + 22) = (u_short) htons(port);
    ^
main.c:316:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:316:12: error: expected expression before ‘)’ token
  *(u_short*)(gram + 22) = (u_short) htons(port);
            ^
main.c:316:37: error: expected ‘;’ before ‘htons’
  *(u_short*)(gram + 22) = (u_short) htons(port);
                                     ^
main.c:347:59: error: dereferencing pointer to incomplete type
      rcv_ifindex = ((struct in_pktinfo *) CMSG_DATA(cmsg))->ipi_ifindex;
                                                           ^
main.c:374:13: error: expected expression before ‘)’ token
   *(u_short*)(gram + 20) = (u_short) rcv_addr.sin_port;
             ^
main.c:374:38: error: expected ‘;’ before ‘rcv_addr’
   *(u_short*)(gram + 20) = (u_short) rcv_addr.sin_port;
                                      ^
main.c:377:13: error: expected expression before ‘)’ token
   *(u_short*)(gram + 24) = htons(8 + len);
             ^
main.c:378:13: error: expected expression before ‘)’ token
   *(u_short*)(gram + 2) = htons(28 + len);
             ^
main.c:392:21: error: expected expression before ‘)’ token
     ntohs(*(u_short*) (gram + 22)), /* dst port */
                     ^
make: *** [udp-broadcast-relay] Error 1
[root@TURMERIC udp-broadcast-relay]# c99 --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Can't find the TTL!

Hi I was using your util but it couldn't find the TTL of some incoming packets, exiting with the message:

TTL not found on incoming packet
: Success

I have your utility running as ./udp-broadcast-relay -d 1 27036 br0 vlan2
on a DD-WRT v24-sp2 router: Linux DD-WRT 2.4.37 #13289 Thu Aug 12 02:43:07 CEST 2010 mips unknown.

I've noticed that when it is iterating through all the packet headers it only goes through one iteration,
and never hits the IP_TTL message header type.

Another issue I noticed is that only broadcast messages from br0 are being detected and none from vlan2, some info about them:

br0       Link encap:Ethernet  HWaddr 00:23:69:4A:B7:0B  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1

vlan2     Link encap:Ethernet  HWaddr 00:23:69:4A:B7:0C  
          inet addr:128.61.105.148  Bcast:128.61.107.255  Mask:255.255.252.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

Thank you!

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.