85 lines
2.0 KiB
Plaintext
85 lines
2.0 KiB
Plaintext
/*
|
|
* Copyright 1991, Silicon Graphics, Inc.
|
|
* All Rights Reserved.
|
|
*
|
|
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
|
|
* the contents of this file may not be disclosed to third parties, copied or
|
|
* duplicated in any form, in whole or in part, without the prior written
|
|
* permission of Silicon Graphics, Inc.
|
|
*
|
|
* RESTRICTED RIGHTS LEGEND:
|
|
* Use, duplication or disclosure by the Government is subject to restrictions
|
|
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
|
|
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
|
|
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
|
|
* rights reserved under the Copyright Laws of the United States.
|
|
*
|
|
* $Revision: 1.3 $
|
|
*/
|
|
|
|
/*
|
|
* AppleTalk Routing Table Maintenance Protocol
|
|
*/
|
|
|
|
import ddp;
|
|
|
|
protocol rtmp "AppleTalk Routing Table Maintenance Protocol"
|
|
: ddp(5), ddp(1)
|
|
{
|
|
enum rtmpfunc {
|
|
Request=1, SplitHorizonReq=2, NoSplitHorizonReq=3
|
|
};
|
|
|
|
enum rangeflag {
|
|
NonExt, Extended
|
|
};
|
|
|
|
// For handling nonextended network with a misleading flag.
|
|
enum nonext {
|
|
NonExtended, Filler
|
|
};
|
|
|
|
struct routinfo
|
|
{
|
|
// if the bytes are -- -- 0x0- or 00 00 0x82
|
|
if (!flag || (!nnum && flag && distance == 2))
|
|
{
|
|
u_short nnum "Network Number" -v;
|
|
nonext flag "Range Flag" : 1 -v;
|
|
if (flag)
|
|
u_char filler "Filler Value" : 7 -vv;
|
|
else
|
|
u_char distance "Distance" : 7 -v;
|
|
}
|
|
else
|
|
{
|
|
u_short startnum "Network Number Range Start" -v;
|
|
rangeflag start "Range Flag" : 1 -vv;
|
|
u_char dist "Distance" : 7 -v;
|
|
u_short endnum "Network Number Range End" -v;
|
|
u_char end "Routing Tuple End" -vv expect 0x82;
|
|
}
|
|
};
|
|
|
|
switch (ddp.type)
|
|
{
|
|
case 5:
|
|
rtmpfunc func "RTMP Request Function Code" : 8;
|
|
|
|
case 1:
|
|
u_short snetnum "Sender's Network Number";
|
|
u_char idlen "Node ID Length in Bits" -v;
|
|
u_char snodeid "Sender's Node ID" [idlen/8];
|
|
if (tuples_needed($ds))
|
|
routinfo tuples [];
|
|
}
|
|
}
|
|
|
|
%{
|
|
static int
|
|
tuples_needed(DataStream *ds)
|
|
{
|
|
return ds->ds_count > 0;
|
|
}
|
|
%}
|