cGull wrote:
>>Before you can broadcast , you need to add a route to your kernel
>>routing table..
>>
>>route add -net 224.0.0.0 netmask 224.0.0.0 ethX
>>
>>where, ethX is your network interface.
>>
>>
>>HTH
>>Manu
>>
>>
>>
>
>Those are multicast addresses you have given Manu, not broadcast
>addresses !
>
>
>
Ah, sorry i had somebody pestering me for some multicast stuff, my mind
was in that frameset/thoughts..
From page 7 of the manual for IP, it says set the SO_BROADCAST flag.
IP(7) Linux Programmer’s Manual IP(7)
NAME
ip - Linux IPv4 protocol implementation
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
tcp_socket = socket(PF_INET, SOCK_STREAM, 0);
raw_socket = socket(PF_INET, SOCK_RAW, protocol);
udp_socket = socket(PF_INET, SOCK_DGRAM, protocol);
<--snip-->
ADDRESS FORMAT
An IP socket address is defined as a combination of an IP interface
address and a port number. The basic IP protocol does not supply port
numbers, they are implemented by higher level protocols like udp(7) and
tcp(7). On raw sockets sin_port is set to the IP protocol.
struct sockaddr_in {
sa_family_t sin_family; /* address family: AF_INET */
u_int16_t sin_port; /* port in network byte order */
struct in_addr sin_addr; /* internet address */
};
/* Internet address. */
struct in_addr {
u_int32_t s_addr; /* address in network byte order */
};
sin_family is always set to AF_INET. This is required; in Linux 2.2
most networking functions return EINVAL when this setting is missing.
sin_port contains the port in network byte order. The port numbers
below 1024 are called reserved ports. Only processes with effective
user id 0 or the CAP_NET_BIND_SERVICE capability may bind(2) to these
sockets. Note that the raw IPv4 protocol as such has no concept of a
port, they are only implemented by higher protocols like tcp(7) and
udp(7).
sin_addr is the IP host address. The addr member of struct in_addr
contains the host interface address in network order. in_addr should
be only accessed using the inet_aton(3), inet_addr(3), inet_makeaddr(3)
library functions or directly with the name resolver (see gethostby-
name(3)). IPv4 addresses are divided into unicast, broadcast and mul-
ticast addresses. Unicast addresses specify a single interface of a
host, broadcast addresses specify all hosts on a network and multicast
addresses address all hosts in a multicast group. Datagrams to broad-
cast addresses can be only sent or received when the SO_BROADCAST
socket flag is set. In the current implementation connection oriented
sockets are only allowed to use unicast addresses.
Manu
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/0XFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/dubailug/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/