CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2012
    Posts
    3

    Broadcast with RAW Socket ???

    Can we send a Broadcast Packet via RAW Socket ?? I am unable to send it as "sendto" is returning err-101(Network Unreachable). I already Enabled the Broadcast Socket Option and IPHDR_INCL Options. Any Suggestions ??


    -Thnx,
    KeWLGuY

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Broadcast with RAW Socket ???

    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #3
    Join Date
    Jul 2012
    Posts
    3

    Re: Broadcast with RAW Socket ???

    Thanks S_M_A for the link. That's informational.I am following all the Rules mentioned in the link. Socket type was DGRAM & Machine is having Valid IP Address & I am filling the IPHEADER with that IP Address and also enabled BROADCAST Option & IPHDR_INCL Options. Destination address was also filled up as "BROADCAST" Address & trying to send the packet via "sendto". Still; no Luck for me .Please let me know ; if U want me to send the code ?

  4. #4
    Join Date
    Jul 2012
    Posts
    3

    Re: Broadcast with RAW Socket ???

    Finally able to send the Broadcast via RAW Socket. Actual issue is not with Code. It is with System not having Default Gateway. Another Query was; How can I send the VLAN Information to application via RAW Sockets ?? Kernel is removing the 4 bytes VLAN Information and sending the remaining Ether/IP/UDP information. VLAN ID is not going to application.

    Looking for some suggestions.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured