Subject: RE: draft-ietf-mpls-tc-mib-06a.txt

From: "Wijnen, Bert (Bert)" <[email-masked]>
Date: Wed, 1 Oct 2003 17:03:48 +0200

> >Sure... in C-code, you can do
> >
> >  typedef struct und_union teHopAddress {
> >      int                 type;    /* enums for ip, as, unnum, lspid */
> >      unsigned char[256]  address; /* format depends on type */
> >  } TeHopAddress;
> >
> >and then later one could do
> >
> >  struct someTableEntry {
> >    /* index stuff  */
> >    TeHopAddres      address;
> >    unsigned char[4] as;     /* AS number if address.type is set to 'as' */
> >    unsigned char[4] unnum;  /* ifnumber if address.type is set to 'as' */
> >    unsigned char[6] lspId;  /* lspid if address.type is set to 'as' */
> >  }
> >
> >Does that sound/look like good programming?
> >Well, I think not... but I have to admit that it was a few years
> >ago that I last wrote C-code  :-((
> 
> 	Whether it is great or not, I am not sure,
> but the point is that there are cases where you need
> more than one of those fields at the same time.
> If that example hadn't been brought up, I agree
> with you that a single union was okay. In fact, I
> had originally been making this change when it
> was pointed out that we shouldn't remove it
> for the reasons I gave earlier.
> 
If you DO NEED more than one column, then you would do (in C code):

  struct someTableEntry {
   /* index stuff  */
   TeHopAddres      address;
   TeHopAddres      asAddress; 
   TeHopAddres      unnum;
   TeHopAddress     lspId;
  }

That is, they would all 4 be discriminated unions, and you would NOT
make the 2nd,3rd,4th addresses be discriminated by a subfield in
the address struct would you...??

Oh well... I have enough of this.

Bert
> 	--Tom

---

From: "Thomas D. Nadeau" <[email-masked]>
Date: Wed, 1 Oct 2003 11:28:37 -0400

>-----Original Message-----
>From: Wijnen, Bert (Bert) [mailto:[email-masked]] 
>Sent: Wednesday, October 01, 2003 11:04 AM
>To: [email-masked]'; 'Mpls (E-mail)'
>Cc: [email-masked]; [email-masked]; 
>[email-masked]; [email-masked]; 'Joan 
>Cucchiara x302'; 'Kireeti Kompella'; [email-masked]; 
>[email-masked]; [email-masked]; [email-masked]; [email-masked]
>Subject: RE: draft-ietf-mpls-tc-mib-06a.txt
>
>

	We have a TeHopAddressType defined already.
So would this only apply to the address field? 
This tells you how to interpret the field, no?
In the case of the address it could be Ipv4 or 
Ipv6. So you would actually need:

   TeHopAddressType  addressType
   TeHopAddress      address;
   TeHopAddress      asAddress; 
   TeHopAddress      unnum;
   TeHopAddress      lspId;

	instead of:

  mplsTunnelHopAddrType           TeHopAddressType,
  mplsTunnelHopIpAddr             TeHopAddress,
  mplsTunnelHopAsNumber           TeHopAddressAS,
  mplsTunnelHopAddrUnnum          TeHopAddressUnnum,
  mplsTunnelHopLspId              MplsLSPID,

	Also, the descriptions of the last three 
(asAddress, addressUnnum and lspId) would
need to be changed so that the interpretation
of those would be a MUST on the subtype of
TeHopAddress. Not sure off-hand where else these
things might be referenced from. These changes 
will need to be made in three tables too (there are 
3 hop tables).  Seems like a lot of churn and potential 
for error in exchange for little return IMHO,
which is why I pushed back.

>Oh well... I have enough of this.

	You can say that again. *)

	--Tom

---

From: "Thomas D. Nadeau" <[email-masked]>
Date: Wed, 1 Oct 2003 11:31:05 -0400

>From: [email-masked] [mailto:[email-masked]] On Behalf 
>Of Wijnen, Bert (Bert)

	Well, sort of. You still need the IpAddressType
because that can be IPv4 or IPv6.

	--Tom