17 #include <netinet/in.h>
41 static int umcast_user_init(
void *
data,
void *
dev)
54 static void umcast_remove(
void *data)
64 static int umcast_open(
void *data)
83 "errno = %d\n", errno);
90 "errno = %d\n", errno);
97 sizeof(pri->
ttl)) < 0) {
100 "failed, error = %d\n", errno);
106 &yes,
sizeof(yes)) < 0) {
109 "failed, error = %d\n", errno);
115 if (bind(fd, (
struct sockaddr *) lsin,
sizeof(*lsin)) < 0) {
118 "errno = %d\n", errno);
124 mreq.imr_multiaddr.s_addr = lsin->
sin_addr.s_addr;
125 mreq.imr_interface.s_addr = 0;
127 &mreq,
sizeof(mreq)) < 0) {
130 "failed, error = %d\n", errno);
132 "multicast-capable network interface on the "
135 "to use the multicast transport.\n");
148 static void umcast_close(
int fd,
void *data)
156 mreq.imr_multiaddr.s_addr = lsin->
sin_addr.s_addr;
157 mreq.imr_interface.s_addr = 0;
159 &mreq,
sizeof(mreq)) < 0) {
161 "failed, error = %d\n", errno);
172 return net_sendto(fd, buf, len, data_addr,
sizeof(*data_addr));
176 .init = umcast_user_init,
178 .close = umcast_close,
179 .remove = umcast_remove,
181 .delete_address =
NULL,