-/* $OpenBSD: parse.y,v 1.420 2021/10/15 15:01:27 naddy Exp $ */
+/* $OpenBSD: parse.y,v 1.421 2022/02/22 17:24:12 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
int parseextcommunity(struct community *, char *,
char *);
static int new_as_set(char *);
-static void add_as_set(u_int32_t);
+static void add_as_set(uint32_t);
static void done_as_set(void);
static struct prefixset *new_prefix_set(char *, int);
-static void add_roa_set(struct prefixset_item *, u_int32_t, u_int8_t,
+static void add_roa_set(struct prefixset_item *, uint32_t, uint8_t,
time_t);
static struct rtr_config *get_rtr(struct bgpd_addr *);
static int insert_rtr(struct rtr_config *);
long long number;
char *string;
struct bgpd_addr addr;
- u_int8_t u8;
+ uint8_t u8;
struct filter_rib_l *filter_rib;
struct filter_peers_l *filter_peers;
struct filter_match_l filter_match;
struct filter_set_head *filter_set_head;
struct {
struct bgpd_addr prefix;
- u_int8_t len;
+ uint8_t len;
} prefix;
struct filter_prefixlen prefixlen;
struct prefixset_item *prefixset_item;
struct {
- u_int8_t enc_alg;
+ uint8_t enc_alg;
+ uint8_t enc_key_len;
char enc_key[IPSEC_ENC_KEY_LEN];
- u_int8_t enc_key_len;
} encspec;
} v;
int lineno;
as4number : STRING {
const char *errstr;
char *dot;
- u_int32_t uvalh = 0, uval;
+ uint32_t uvalh = 0, uval;
if ((dot = strchr($1,'.')) != NULL) {
*dot++ = '\0';
| asnumber {
if ($1 == AS_TRANS || $1 == 0) {
yyerror("AS %u is reserved and may not be used",
- (u_int32_t)$1);
+ (uint32_t)$1);
YYERROR;
}
$$ = $1;
as4number_any : STRING {
const char *errstr;
char *dot;
- u_int32_t uvalh = 0, uval;
+ uint32_t uvalh = 0, uval;
if ((dot = strchr($1,'.')) != NULL) {
*dot++ = '\0';
;
address : STRING {
- u_int8_t len;
+ uint8_t len;
if (!host($1, &$$, &len)) {
yyerror("could not parse address spec \"%s\"",
curpeer->conf.min_holdtime = $3;
}
| ANNOUNCE family safi {
- u_int8_t aid, safi;
- u_int16_t afi;
+ uint8_t aid, safi;
+ uint16_t afi;
if ($3 == SAFI_NONE) {
for (aid = 0; aid < AID_MAX; aid++) {
}
| ANNOUNCE ADDPATH RECV yesno {
int8_t *ap = curpeer->conf.capabilities.add_path;
- u_int8_t i;
+ uint8_t i;
for (i = 0; i < AID_MAX; i++)
if ($4)
curpeer->conf.auth.method = AUTH_IPSEC_IKE_AH;
}
| IPSEC espah inout SPI NUMBER STRING STRING encspec {
- u_int32_t auth_alg;
- u_int8_t keylen;
+ uint32_t auth_alg;
+ uint8_t keylen;
if (curpeer->conf.auth.method &&
(((curpeer->conf.auth.spi_in && $3 == 1) ||
free($2);
}
| community delete STRING {
- u_int8_t f1, f2, f3;
+ uint8_t f1, f2, f3;
if (($$ = calloc(1, sizeof(struct filter_set))) == NULL)
fatal(NULL);
}
static int
-getcommunity(char *s, int large, u_int32_t *val, u_int32_t *flag)
+getcommunity(char *s, int large, uint32_t *val, uint32_t *flag)
{
long long max = USHRT_MAX;
const char *errstr;
}
static void
-setcommunity(struct community *c, u_int32_t as, u_int32_t data,
- u_int32_t asflag, u_int32_t dataflag)
+setcommunity(struct community *c, uint32_t as, uint32_t data,
+ uint32_t asflag, uint32_t dataflag)
{
c->flags = COMMUNITY_TYPE_BASIC;
c->flags |= asflag << 8;
parselargecommunity(struct community *c, char *s)
{
char *p, *q;
- u_int32_t dflag1, dflag2, dflag3;
+ uint32_t dflag1, dflag2, dflag3;
if ((p = strchr(s, ':')) == NULL) {
yyerror("Bad community syntax");
parsecommunity(struct community *c, int type, char *s)
{
char *p;
- u_int32_t as, data, asflag, dataflag;
+ uint32_t as, data, asflag, dataflag;
if (type == COMMUNITY_TYPE_LARGE)
return parselargecommunity(c, s);
}
static int
-parseextvalue(int type, char *s, u_int32_t *v, u_int32_t *flag)
+parseextvalue(int type, char *s, uint32_t *v, uint32_t *flag)
{
const char *errstr;
char *p;
struct in_addr ip;
- u_int32_t uvalh, uval;
+ uint32_t uvalh, uval;
if (type != -1) {
/* nothing */
{
const struct ext_comm_pairs *cp;
char *p, *ep;
- u_int64_t ullval;
- u_int32_t uval, uval2, dflag1 = 0, dflag2 = 0;
+ uint64_t ullval;
+ uint32_t uval, uval2, dflag1 = 0, dflag2 = 0;
int type = 0, subtype = 0;
if (strcmp(t, "*") == 0 && strcmp(s, "*") == 0) {
alloc_peer(void)
{
struct peer *p;
- u_int8_t i;
+ uint8_t i;
if ((p = calloc(1, sizeof(struct peer))) == NULL)
fatal("new_peer");
int
get_id(struct peer *newpeer)
{
- static u_int32_t id = PEER_ID_STATIC_MIN;
+ static uint32_t id = PEER_ID_STATIC_MIN;
struct peer *p = NULL;
/* check if the peer already existed before */
int
merge_prefixspec(struct filter_prefix *p, struct filter_prefixlen *pl)
{
- u_int8_t max_len = 0;
+ uint8_t max_len = 0;
switch (p->addr.aid) {
case AID_INET:
return -1;
}
- aset = as_sets_new(&conf->as_sets, name, 0, sizeof(u_int32_t));
+ aset = as_sets_new(&conf->as_sets, name, 0, sizeof(uint32_t));
if (aset == NULL)
fatal(NULL);
}
static void
-add_as_set(u_int32_t as)
+add_as_set(uint32_t as)
{
if (curset == NULL)
fatalx("%s: bad mojo jojo", __func__);
}
static void
-add_roa_set(struct prefixset_item *npsi, u_int32_t as, u_int8_t max,
+add_roa_set(struct prefixset_item *npsi, uint32_t as, uint8_t max,
time_t expires)
{
struct roa *roa, *r;