summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1998-11-20 07:34:08 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1998-11-20 07:34:08 +0000
commiteb4416d4df1aa88945ba6589b2ff66981feef9b3 (patch)
treebc480a59dd84037503a0af09a2ea731ef334b041 /sbin
parentdfb2717d72205a17c5cd0fd2fc618b4e581593b8 (diff)
Add submaps to constant maps, and add a mechanism to the constant
description language to link maps.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/constants.c15
-rw-r--r--sbin/isakmpd/constants.h6
-rw-r--r--sbin/isakmpd/genconstants.sh7
-rw-r--r--sbin/isakmpd/ipsec_num.cst18
4 files changed, 30 insertions, 16 deletions
diff --git a/sbin/isakmpd/constants.c b/sbin/isakmpd/constants.c
index 0d4a20c6420..f58d0e5072a 100644
--- a/sbin/isakmpd/constants.c
+++ b/sbin/isakmpd/constants.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: constants.c,v 1.3 1998/11/17 11:10:08 niklas Exp $ */
-/* $EOM: constants.c,v 1.4 1998/08/28 23:04:27 niklas Exp $ */
+/* $OpenBSD: constants.c,v 1.4 1998/11/20 07:34:06 niklas Exp $ */
+/* $EOM: constants.c,v 1.5 1998/11/20 07:17:00 niklas Exp $ */
/*
* Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
@@ -61,6 +61,17 @@ constant_lookup (struct constant_map *map, int value)
return 0;
}
+struct constant_map *
+constant_link_lookup (struct constant_map *map, int value)
+{
+ struct constant_map *entry = map;
+
+ for (entry = map; entry->name; entry++)
+ if (entry->value == value)
+ return entry->link;
+ return 0;
+}
+
char *
constant_name (struct constant_map *map, int value)
{
diff --git a/sbin/isakmpd/constants.h b/sbin/isakmpd/constants.h
index 55cf9709390..dbf3d9bd7d4 100644
--- a/sbin/isakmpd/constants.h
+++ b/sbin/isakmpd/constants.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: constants.h,v 1.3 1998/11/17 11:10:08 niklas Exp $ */
-/* $EOM: constants.h,v 1.4 1998/08/28 23:04:28 niklas Exp $ */
+/* $OpenBSD: constants.h,v 1.4 1998/11/20 07:34:06 niklas Exp $ */
+/* $EOM: constants.h,v 1.5 1998/11/20 07:17:01 niklas Exp $ */
/*
* Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
@@ -40,8 +40,10 @@
struct constant_map {
int value;
char *name;
+ struct constant_map *link;
};
+struct constant_map *constant_link_lookup (struct constant_map *, int);
extern char *constant_lookup (struct constant_map *, int);
extern char *constant_name (struct constant_map *, int);
extern char *constant_name_maps (struct constant_map **, int);
diff --git a/sbin/isakmpd/genconstants.sh b/sbin/isakmpd/genconstants.sh
index acb16776f91..aca78ca463c 100644
--- a/sbin/isakmpd/genconstants.sh
+++ b/sbin/isakmpd/genconstants.sh
@@ -1,5 +1,6 @@
-# $OpenBSD: genconstants.sh,v 1.2 1998/11/17 11:10:11 niklas Exp $
-# $EOM: genconstants.sh,v 1.2 1998/07/24 22:25:42 niklas Exp $
+# $OpenBSD: genconstants.sh,v 1.3 1998/11/20 07:34:07 niklas Exp $
+# $EOM: genconstants.sh,v 1.3 1998/11/20 07:17:02 niklas Exp $
+# $EOM: genconstants.sh,v 1.3 1998/11/20 07:17:02 niklas Exp $
#
# Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
@@ -106,7 +107,7 @@ BEGIN {
}
/^[ ]/ && $1 {
- printf (" { %s_%s, \"%s\" }, \n", prefix, $1, $1)
+ printf (" { %s_%s, \"%s\", %s }, \n", prefix, $1, $1, $3 ? $3 : 0)
next
}
diff --git a/sbin/isakmpd/ipsec_num.cst b/sbin/isakmpd/ipsec_num.cst
index 9e067f9c07b..7698f8f8962 100644
--- a/sbin/isakmpd/ipsec_num.cst
+++ b/sbin/isakmpd/ipsec_num.cst
@@ -1,5 +1,5 @@
-# $OpenBSD: ipsec_num.cst,v 1.3 1998/11/17 11:10:14 niklas Exp $
-# $EOM: ipsec_num.cst,v 1.1 1998/07/25 11:19:11 niklas Exp $
+# $OpenBSD: ipsec_num.cst,v 1.4 1998/11/20 07:34:07 niklas Exp $
+# $EOM: ipsec_num.cst,v 1.2 1998/11/20 07:17:03 niklas Exp $
#
# Copyright (c) 1998 Niklas Hallqvist. All rights reserved.
@@ -92,19 +92,19 @@ IPSEC_ID
# IKE SA attributes
IKE_ATTR
- ENCRYPTION_ALGORITHM 1
- HASH_ALGORITHM 2
- AUTHENTICATION_METHOD 3
- GROUP_DESCRIPTION 4
- GROUP_TYPE 5
+ ENCRYPTION_ALGORITHM 1 ike_encrypt_cst
+ HASH_ALGORITHM 2 ike_hash_cst
+ AUTHENTICATION_METHOD 3 ike_auth_cst
+ GROUP_DESCRIPTION 4 ike_group_desc_cst
+ GROUP_TYPE 5 ike_group_cst
GROUP_PRIME 6
GROUP_GENERATOR_1 7
GROUP_GENERATOR_2 8
GROUP_CURVE_A 9
GROUP_CURVE_B 10
- LIFE_TYPE 11
+ LIFE_TYPE 11 ike_duration_cst
LIFE_DURATION 12
- PRF 13
+ PRF 13 ike_prf_cst
KEY_LENGTH 14
FIELD_SIZE 15
GROUP_ORDER 16