From: Ling, X. <xia...@in...> - 2004-02-24 08:27:23
|
Hi, Jon. We figure out the patch for multicast part. This patch does not include the 4 files I checked in last time. If it has no problem, you can merge it with your code and check in. When debuging, to eliminate the effect of these multicast codes, just comment out two lines including "btlink_create" and "btlink_delete". --------------------------------------------------------------------- Index: driver.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/tipc/source/unstable/net/tipc/driver.c,v retrieving revision 1.10 diff -u -r1.10 driver.c --- driver.c 16 Feb 2004 23:00:01 -0000 1.10 +++ driver.c 24 Feb 2004 07:58:50 -0000 @@ -138,6 +143,7 @@ #include <tipc_bearer.h> #include <tipc_dbg.h> #include <tipc_port.h> +#include <bcast.h> =20 #ifdef TIPC_LINUX_2_4 EXPORT_NO_SYMBOLS; @@ -201,6 +207,7 @@ return -EINVAL; eth_media_start(eth); udp_media_start(udp0); + tipc_bcast_start(); sock_start(); return 0; } Index: link.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/tipc/source/unstable/net/tipc/link.c,v retrieving revision 1.7 diff -u -r1.7 link.c --- link.c 16 Feb 2004 23:00:01 -0000 1.7 +++ link.c 24 Feb 2004 07:58:51 -0000 @@ -550,6 +551,9 @@ strcpy((char *) msg_data(msg),bearer_strip_name(b->publ.name)); this->owner =3D node_attach_link(this); k_signal((Handler) link_start, (void *)this); + if (in_own_cluster(this->owner->addr)) {=20 + btlink_create(this, b); + } return this; } =20 @@ -565,6 +569,7 @@ if (!this) return; dbg("link_delete()\n"); + btlink_delete(this); link_reset(this); node_detach_link(this->owner,this); link_stop(this); @@ -1738,6 +1743,9 @@ spin_unlock_bh(&this->owner->lock); port_recv_proto_msg(buf); return; + case BCAST_PROTOCOL: + spin_unlock_bh(&this->owner->lock); + link_recv_bcast_proto_msg(this, buf); =20 default: spin_unlock_bh(&this->owner->lock); net_route_msg(buf); Index: node.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/tipc/source/unstable/net/tipc/node.h,v retrieving revision 1.6 diff -u -r1.6 node.h --- node.h 16 Feb 2004 23:00:02 -0000 1.6 +++ node.h 24 Feb 2004 07:58:51 -0000 @@ -97,6 +95,10 @@ uint last_in_bcast; uint acked_bcast; spinlock_t lock; + int gap; /* gap between exp_seq and unseqencial data package, request peer to restransmit*/ + int deferred_inqueue_sz; + struct sk_buff *deferred_in; + =09 }; =20 =20 @@ -104,6 +106,7 @@ void node_delete(struct node*); struct node* node_attach_link(struct link* link); void node_detach_link(struct node*,struct link* link); +struct link* node_get_other_link(struct node*,struct link* link); void node_link_down(struct node*,struct link* link); void node_link_up(struct node*,struct link* link); int node_has_active_links(struct node* this); Index: port.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/tipc/source/unstable/net/tipc/port.c,v retrieving revision 1.6 diff -u -r1.6 port.c --- port.c 16 Feb 2004 23:00:02 -0000 1.6 +++ port.c 24 Feb 2004 07:58:52 -0000 @@ -383,11 +384,17 @@ buf_discard(buf); return TIPC_OK; } - - rbuf =3D buf_acquire(data_sz + LONG_H_SIZE); + if (msg_mcast(msg)) + rbuf =3D buf_acquire(data_sz + MCAST_H_SIZE); + else + rbuf =3D buf_acquire(data_sz + LONG_H_SIZE); rmsg =3D buf_msg(rbuf); - msg_init(rmsg,imp,msg_type(msg),err, - LONG_H_SIZE,msg_orignode(msg)); + if (msg_mcast(msg)) + msg_init(rmsg,imp,msg_type(msg),err, + MCAST_H_SIZE,msg_orignode(msg)); + else + msg_init(rmsg,imp,msg_type(msg),err, + LONG_H_SIZE,msg_orignode(msg)); msg_set_destport(rmsg, msg_origport(msg)); msg_set_prevnode(rmsg, tipc_own_addr); msg_set_origport(rmsg, msg_destport(msg)); @@ -395,15 +402,23 @@ msg_set_orignode(rmsg,tipc_own_addr); else msg_set_orignode(rmsg,msg_destnode(msg)); - msg_set_size(rmsg, data_sz + LONG_H_SIZE); - msg_set_nametype(rmsg, msg_nametype(msg)); - msg_set_nameinst(rmsg, msg_nameinst(msg)); - buf_copy_append(rbuf,LONG_H_SIZE,msg_data(msg),data_sz); + msg_set_nametype(rmsg, msg_nametype(msg)); + msg_set_nameinst(rmsg, msg_nameinst(msg)); + + if (msg_mcast(msg)){ + msg_set_size(rmsg, data_sz + MCAST_H_SIZE); + msg_set_nameupper(rmsg,msg_nameupper(msg)); + buf_copy_append(rbuf,MCAST_H_SIZE,msg_data(msg),data_sz); + } + else{=09 + msg_set_size(rmsg, data_sz + LONG_H_SIZE); + buf_copy_append(rbuf,LONG_H_SIZE,msg_data(msg),data_sz); + } +=09 buf_discard(buf); net_route_msg(rbuf); return TIPC_OK; } - static int port_reject_sections(struct tipc_msg* hdr, struct tipc_msg_section const *sseq, @@ -1375,17 +1390,6 @@ } =20 =20 -int -tipc_multicast_buf(tipc_ref_t portref,=20 - struct tipc_name_seq const *seq,=20 - tipc_net_addr_t domain, /* 0:own zone */ - void *buf, - uint size) -{ - warn("Multicast not implemented\n"); - return TIPC_FAILURE; -} - =20 void port_stop(void) |