[Xorp-hackers] [PIM] Setting a bit in the Encoded source address
Pavlin Radoslavov
pavlin at icir.org
Wed Mar 7 10:14:13 PST 2007
> > > We have to set the bidirectional bit in the ENCODED GROUP ADDRESS
> > >
> > >
> > > 0 1 2 3
> > > 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> > > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> > > | Addr Family | Encoding Type |B| Reserved |Z| Mask Len |
> > > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
> > > | Group multicast Address
> > > +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+...
> > >
> > > By using following function we can get octet but how can we set the
> > single
> > > bit ( B )? :)
> > >
> > > i could not get the flow in the following code :
> > >
> > > #define GET_OCTET(val, cp, rcvlen) \
> > > do
> > { \
> > > if ((size_t)(rcvlen) < (size_t)1) \
> > > goto rcvlen_error; \
> > > (rcvlen)--;
> > \
> > > ((val) = *(cp)++); \
> > > } while (0)
> > >
> > > thanking you in anticipation
> >
> > You could use the PUT_OCTET() macro.
> > I believe the remaining 7 bits in the Reserved field are suppose to
> > be 0. Hence you need to use PUT_OCTET() to set both Reserved and Z
> > at the same time (because they belong to the same octet).
>
>
> hello,
> we set that B bit but now we want to check that bit.
> we were able to see the BIDIR_CAPABLE Flag in hello messages using
> ethereal.How can we do the same for checking this B bit???
>
> We made changes as follows
> in file
> ------------------------------------------------------
> -> pim_proto.hh
> #define EGADDR _B_BIT 0x80
The correct definition for the bit is 0x1, because it is the
least-significant bit in the Reserved octet.
> ------------------------------------------------------
> -> pim_proto_join_prune_message.cc
> group_addr_reserved_flag |= EGADDR _B_BIT
> --------------------------------------------------------------------
> i hope this will do the work!!!!
Yes, but make sure you remove the extra space between
EGADDR and _B_BIT :)
Also, the correct name of the variable is group_addr_reserved_flags
(used inside method PimJpHeader::network_send()).
Regards,
Pavlin
>
> thanking you in anticipation
> Ashish
> Shamita
> Chintamani
>
>
>
>
> Regards,
> > Pavlin
> >
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
More information about the Xorp-hackers
mailing list