/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2002-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* bgp method
*
* Glenn Fowler
* AT&T Research
*/
static const char usage[] =
"[a:anonymize?Anonymize output data for \bbgp-*-anonymize\b formats.]"
;
#include "bgplib.h"
#include "mrt.h"
{
CXV("labels", "labels_t", BGP_labels, "NLRI label list; LHS is label, RHS is COS and end of stack bit.")
CXV("mvpn", "bgp_t", BGP_mvpn, "[Mcast vpn data using members of the main schema; access as \bmvpn\b.\amember\a:]{[+agg_addr?VPN_S_PMSI_A_D multicast address.][+key?Route key NLRI.][+originator?Originator ipv4 address.][+rd_addr?Route distinguisher address.][+rd_as?Route distinguisher AS number.][+rd_number?Route distinguisher assigned number.][+rd_type?Route distinguisher type.][+src_addr?Source address.][+src_as?Originator AS number.][+type?The route type index.]}")
CXV("safi", "number", BGP_safi, "Announce subsequent address family identifier bits: 1:unicast, 2:multicast, 4:MLPS-label, 5:MCAST-VPN, 128:MLPS-labeled-VPN.")
CXV("type", "number", BGP_type, "Record type:: 'A':announce, 'K':keepalive, 'N':notification, 'O':open, 'S':state, 'T':table, 'W':withdraw.")
CXV("unknown", "string", BGP_unknown, "Unknown attributes in the form: \"<flag-i>:<type-i>:<size-i>:<hex-data-i>;...\".")
CXD("cluster_len", "number", BGP_cluster_len, "DEPRECATED -- use sizeof(cluster). Cluster id list length.")
CXD("community_len", "number", BGP_community_len, "DEPRECATED -- use sizeof(community). Community of interest id list length.")
CXD("extended_len", "number", BGP_extended_len, "DEPRECATED -- use sizeof(extended). Extended community list length.")
CXD("labels_len", "number", BGP_labels_len, "DEPRECATED -- use sizeof(labels). NLRI label list length.")
{0}
};
static int
op_get(Cx_t* cx, Cxinstruction_t* pc, Cxoperand_t* r, Cxoperand_t* a, Cxoperand_t* b, void* data, Cxdisc_t* disc)
{
{
case BGP_afi:
break;
case BGP_agg_addr:
{
}
else
{
}
break;
case BGP_agg_addrv4:
break;
case BGP_agg_addrv6:
break;
case BGP_agg_addr32:
{
}
else
{
}
break;
case BGP_agg_addr32v4:
break;
case BGP_agg_addr32v6:
break;
case BGP_agg_as:
break;
case BGP_agg_as16:
break;
case BGP_agg_as32:
break;
case BGP_bits:
break;
case BGP_bitsv4:
break;
case BGP_bitsv6:
break;
case BGP_cluster:
break;
case BGP_community:
break;
case BGP_dpa_addr:
{
}
else
{
}
break;
case BGP_dpa_addrv4:
break;
case BGP_dpa_addrv6:
break;
case BGP_dpa_as:
break;
case BGP_dpa_as16:
break;
case BGP_dpa_as32:
break;
case BGP_dst_addr:
{
}
else
{
}
break;
case BGP_dst_addrv4:
break;
case BGP_dst_addrv6:
break;
case BGP_dst_as:
break;
case BGP_dst_as16:
break;
case BGP_dst_as32:
break;
case BGP_extended:
break;
case BGP_flags:
break;
case BGP_hop:
{
}
else
{
}
break;
case BGP_hopv4:
break;
case BGP_hopv6:
break;
case BGP_id:
break;
case BGP_label:
break;
case BGP_labels:
break;
case BGP_local:
break;
case BGP_med:
break;
case BGP_message:
break;
case BGP_mvpn:
break;
case BGP_new_state:
break;
case BGP_old_state:
break;
case BGP_origin:
break;
case BGP_originator:
{
}
else
{
}
break;
case BGP_path:
{
}
else
{
}
break;
case BGP_path16:
break;
case BGP_path32:
break;
case BGP_prefix:
{
}
else
{
}
break;
case BGP_prefixv4:
break;
case BGP_prefixv6:
break;
case BGP_rd_addr:
{
}
else
{
}
break;
case BGP_rd_as:
break;
case BGP_rd_number:
break;
case BGP_rd_type:
break;
case BGP_safi:
break;
case BGP_src_addr:
{
}
else
{
}
break;
case BGP_src_addrv4:
break;
case BGP_src_addrv6:
break;
case BGP_src_as:
break;
case BGP_src_as16:
break;
case BGP_src_as32:
break;
case BGP_stamp:
break;
case BGP_time:
break;
case BGP_type:
break;
case BGP_unknown:
break;
case BGP_usec:
break;
case BGP_weight:
break;
/*DEPRECATED*/
case BGP_cluster_len:
break;
case BGP_community_len:
break;
case BGP_extended_len:
break;
case BGP_labels_len:
break;
case BGP_path_len:
break;
case BGP_path16_len:
break;
case BGP_path32_len:
break;
default:
break;
}
return 0;
}
{
};
static int
bgp_get(Cx_t* cx, Cxinstruction_t* pc, Cxoperand_t* r, Cxoperand_t* a, Cxoperand_t* b, void* data, Cxdisc_t* disc)
{
void* save;
int i;
DSSRECORD(data)->data = &BGPDATA(data)->sub + (((Cxvariable_t*)pc->data.variable)->index == BGP_key);
return i;
}
{
0,
};
{
{ "bgp_t", "BGP route data.", { { 0 }, CX_REFERENCED }, (Cxtype_t*)"number", 0, 0, 0, 0, 0, 0, 0, { 0, 0, CX_UNSIGNED|CX_INTEGER, 4 }, 0, &bgp_member },
{ 0 }
};
/*
* methf
*/
extern Dsslib_t dss_lib_bgp;
static Dssmeth_t*
bgpmeth(const char* name, const char* options, const char* schema, Dssdisc_t* disc, Dssmeth_t* meth)
{
int i;
char* s;
{
return 0;
for (i = 0; i < elementsof(local_callouts); i++)
return 0;
return 0;
}
if (options)
{
return 0;
i = 0;
for (;;)
{
{
case 'a':
i |= BGP_METHOD_ANONYMIZE;
continue;
case '?':
return 0;
case ':':
return 0;
}
break;
}
if (i)
{
{
return 0;
}
}
}
return meth;
}
/*
* openf
*/
static int
{
{
if (bgp)
return -1;
}
return 0;
}
/*
* closef
*/
static int
{
return -1;
return 0;
}
{
"bgp",
CXH,
0
};
{
"bgp",
"bgp method"
"[-1ls5Pp0?\n@(#)$Id: dss bgp method (AT&T Research) 2012-06-14 $\n]"
CXH,
&libraries[0],
&method,
};