|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 5049 (0x13b9) Types: TextFile Names: »mib.py«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦e83f91978⟧ »EurOpenD22/isode/osimis-2.0.tar.Z« └─⟦d846658bd⟧ └─⟦this⟧ »osimis/smap/mib.py«
-- -- Copyright (c) 1988 University College London -- All rights reserved. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and that any documentation, -- advertising materials, and other materials related to such -- distribution and use acknowledge that the software was developed -- by the Department of Computer Science, University College London. -- The name of the University may not be used to -- endorse or promote products derived from this software without -- specific prior written permission. -- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -- -- pepy directives for encoding and decoding of the MIB attribute types -- By George Pavlou, October 1988 MIB DEFINITIONS ::= %{ #include <stdio.h> #include "isode/rosap.h" #include "msap.h" #include "smiS.h" %} BEGIN DECODER parse Counter [[P int *]] ::= INTEGER [[i *parm]] Gauge [[P int *]] ::= INTEGER [[i *parm]] ComparisonLevels [[P int *]] %{int i; %} ::= %{ for (i = 0; i < 10; i++) parm[i] = COMP_LEVEL_FREE; i = 0; %} SET OF ComparisonLevel [[p &parm[i++] ]] %{ if ( i > 10) return (NOTOK); %} ComparisonLevel [[P int *]] ::= INTEGER [[i *parm]] OffsetValue [[P int *]] ::= INTEGER [[i *parm]] HysteresisInterval [[P int *]] ::= INTEGER [[i *parm]] OnoffSwitch [[P int *]] ::= BOOLEAN [[b *parm]] EventId [[P int *]] ::= INTEGER [[i *parm]] -- Report destinations ReportDestinationList [[P destinationS **]] %{ destinationS **dest = parm; %} ::= SET OF %{ if ((*dest = (destinationS *) calloc(1, sizeof(destinationS))) == (destinationS *) NULL) return (NOTOK); %} ReportDestination [[p *dest]] %{ dest = &(*dest)->Next; %} ReportDestination [[P destinationS *]] ::= CHOICE { pAddress [2] IMPLICIT PAddress [[p &parm->Psap_dest]] %{parm->type = RCI_DEST_PSAP; %}, aEInfo [3] IMPLICIT NULL, -- for future use thisConnection [1] IMPLICIT NULL %{ parm->type = RCI_DEST_FD; %} } PAddress [[P struct PSAPaddrS *]] %{ char *cp; %} ::= SEQUENCE { pSelector Selector [[o cp $ parm->psel_len]] %{ bcopy(cp, parm->psel, parm->psel_len); free(cp); %}, sAddress SAddress [[p &parm->saddr ]] } SAddress [[P struct SSAPaddrS *]] %{ char *cp; %} ::= SEQUENCE { sSelector Selector [[o cp $ parm->ssel_len]] %{ bcopy(cp, parm->ssel, parm->ssel_len); free(cp); %}, tAddress TAddress [[p &parm->taddr]] } TAddress [[P struct TSAPaddrS *]] %{ char *cp; %} ::= SEQUENCE { tSelector Selector [[o cp $ parm->tsel_len]] %{ bcopy(cp, parm->tsel, parm->tsel_len); free(cp); %}, nAddress NAddress [[s cp]] %{ strncpy(parm->naddr, cp, NADDRLEN); free(cp); %} } TAddressList [[P TSAPs **]] %{ TSAPs **tsap = parm; %} ::= SET OF %{ if ((*tsap = (TSAPs *) calloc(1, sizeof(TSAPs))) == (TSAPs *) NULL) return (NOTOK); %} TAddress [[p &(*tsap)->taddr]] %{ tsap = &(*tsap)->Next; %} NAddress ::= OCTETSTRING Selector ::= OCTETSTRING TProtocolState [[P int *]] ::= ENUMERATED [[i *parm]] { undefined (0), tp0 (1), tp1 (2), tp2 (3), tp3 (4), tp4 (5) } ENCODER build ReportDestination [[P struct destinationS *]] ::= CHOICE << parm->type+1 >> { pAddress [2] IMPLICIT PAddress [[p &parm->Psap_dest]], aEInfo [3] IMPLICIT NULL, -- for future use thisConnection [1] IMPLICIT NULL } ComparisonLevels [[P int *]] %{int i = 0; %} ::= SET OF << i = 0; i < 10; i++ >> ComparisonLevel [[p &parm[i] ]] %{ if (parm[i] == COMP_LEVEL_FREE) break; %} ComparisonLevel [[P int *]] ::= INTEGER [[i *parm]] OffsetValue [[P int *]] ::= INTEGER [[i *parm]] HysteresisInterval [[P int *]] ::= INTEGER [[i *parm]] OnoffSwitch [[P int *]] ::= BOOLEAN [[b *parm]] PAddress [[P struct PSAPaddrS *]] ::= SEQUENCE %{ if (parm == (PSAPaddrS *) NULL) return (NOTOK); %} { pSelector Selector [[o parm->psel $ parm->psel_len]], sAddress SAddress [[p &parm->saddr]] } SAddress [[P struct SSAPaddrS *]] ::= SEQUENCE %{ if (parm == (SSAPaddrS *) NULL) return (NOTOK); %} { sSelector Selector [[o parm->ssel $ parm->ssel_len]], tAddress TAddress [[p &parm->taddr]] } TAddress [[P struct TSAPaddrS *]] ::= SEQUENCE %{ if (parm == (TSAPaddrS *) NULL) return (NOTOK); %} { tSelector Selector [[o parm->tsel $ parm->tsel_len]], nAddress NAddress [[p parm->naddr]] } NAddress ::= OCTETSTRING Selector ::= OCTETSTRING END