doi
struct doi *doi = doi_lookup(ISAKMP_DOI_ISAKMP);
doi->decode_ids("local_id: %s, remote_id: %s",
LIST_HEAD(doi_list, doi) doi_tab;
struct doi *
struct doi *doi;
for (doi = LIST_FIRST(&doi_tab); doi && doi->id != doi_id;
doi = LIST_NEXT(doi, link));
return doi;
doi_register(struct doi *doi)
LIST_INSERT_HEAD(&doi_tab, doi, link);
LIST_ENTRY(doi) link;
extern struct doi *doi_lookup(u_int8_t);
extern void doi_register(struct doi *);
if (want_doi != doi) {
exchange = exchange_create(1, 0, doi, type);
exchange_setup_p2(struct message *msg, u_int8_t doi)
exchange = exchange_create(2, 0, doi, GET_ISAKMP_HDR_EXCH_TYPE(buf));
exchange->doi->id, exchange->type, exchange->step));
if (exchange->doi && exchange->doi->free_exchange_data)
exchange->doi->free_exchange_data(exchange->data);
if (exchange->doi)
id_doi = exchange->doi->decode_ids(
exchange->doi->finalize_exchange(msg);
return exchange->doi->exchange_script(exchange->type);
struct doi *doi = exchange->doi;
if (!doi->handle_leftover_payload ||
doi->handle_leftover_payload(msg, i, p))
struct doi *doi = exchange->doi;
doi->initiator : doi->responder;
exchange_create(int phase, int initiator, int doi, int type)
exchange->doi = doi_lookup(doi);
if (exchange->doi->exchange_size) {
exchange->data = calloc(1, exchange->doi->exchange_size);
(unsigned long)exchange->doi->exchange_size);
exchange_establish_p1(struct transport *t, u_int8_t type, u_int32_t doi,
doi = IPSEC_DOI_IPSEC;
doi = ISAKMP_DOI_ISAKMP;
exchange = exchange_create(1, 1, doi, type);
u_int32_t doi = ISAKMP_DOI_ISAKMP;
doi = isakmp_sa->doi->id;
doi = IPSEC_DOI_IPSEC;
doi = ISAKMP_DOI_ISAKMP;
exchange = exchange_create(2, 1, doi, type);
exchange_setup_p1(struct message *msg, u_int32_t doi)
struct doi *doi;
struct doi;
exchange->doi->is_attribute_incompatible, msg)) {
(exchange->doi->decode_ids("initiator id %s, responder"
struct doi *doi = exchange->doi;
spi = doi->get_spi(&spi_sz, protocol_num, msg);
if (doi->proto_size) {
proto->data = calloc(1, doi->proto_size);
(unsigned long)doi->proto_size);
if (doi->proto_init)
doi->proto_init(proto, prot->field);
sa->doi->decode_ids("initiator id: %s, responder id: %s",
static struct doi ipsec_doi = {
static struct doi isakmp_doi = {
if (exchange->doi->validate_situation(p->p + ISAKMP_SA_SIT_OFF, &len,
if (msg->exchange->doi
msg->exchange->doi->validate_attribute, msg)) {
tmp_sa.doi = doi_lookup(ISAKMP_DOI_ISAKMP);
ks = msg->isakmp_sa->doi->get_keystate(msg);
msg->exchange->doi->validate_exchange(exch_type)) {
exchange->keystate = exchange->doi->get_keystate(msg);
u_int32_t doi;
args.doi = doi_sa ? doi_sa->doi->id : ISAKMP_DOI_ISAKMP;
msg->exchange ? msg->exchange->doi->id : ISAKMP_DOI_ISAKMP,
args.doi = sa->doi->id;
args.doi = IPSEC_DOI_IPSEC;
if (msg->exchange->doi->informational_pre_hook)
if (msg->exchange->doi->informational_pre_hook(msg))
SET_ISAKMP_NOTIFY_DOI(buf, args->doi);
SET_ISAKMP_DELETE_DOI(buf, args->doi);
if (msg->exchange->doi->informational_post_hook)
if (msg->exchange->doi->informational_post_hook(msg)) {
exchange->doi->is_attribute_incompatible, msg)) {
struct doi *doi = exchange->doi;
sa_len = ISAKMP_SA_SIT_OFF + doi->situation_size();
SET_ISAKMP_SA_DOI(sa_buf, doi->id);
doi->setup_situation(sa_buf);
if (doi->get_spi) {
spi = doi->get_spi(&spi_sz,
msg->exchange->doi->debug_attribute, msg);
struct doi *doi;
doi = doi_lookup(GET_ISAKMP_DELETE_DOI(p->p));
if (!doi) {
msg->exchange = exchange_setup_p1(msg, doi->id);
msg->exchange = exchange_setup_p2(msg, doi->id);
if (proto != ISAKMP_PROTO_ISAKMP && doi->validate_proto(proto)) {
if (exchange->doi &&
exchange->doi->validate_id_information(GET_ISAKMP_ID_TYPE(p->p),
if (exchange->doi && exchange->doi->validate_key_information(p->p +
struct doi *doi;
doi = doi_lookup(GET_ISAKMP_NOTIFY_DOI(p->p));
if (!doi) {
msg->exchange = exchange_setup_p1(msg, doi->id);
msg->exchange = exchange_setup_p2(msg, doi->id);
if (proto != ISAKMP_PROTO_ISAKMP && doi->validate_proto(proto)) {
doi->validate_notification(type)) ||
msg->exchange->doi->validate_proto(proto)) {
proto->data = calloc(1, sa->doi->proto_size);
(unsigned long)sa->doi->proto_size);
if (sa->doi->proto_init)
sa->doi->proto_init(proto, 0);
sa->doi = exchange->doi;
if (sa->doi->sa_size) {
sa->data = calloc(1, sa->doi->sa_size);
(unsigned long)sa->doi->sa_size);
sa, sa->name ? sa->name : "<unnamed>", sa->phase, sa->doi->id,
!sa->doi ? "<nodoi>" :
sa->doi->decode_ids("initiator id: %s, responder id: %s",
if (sa->doi->delete_spi)
sa->doi->delete_spi(sa, proto, i);
if (sa->doi && sa->doi->free_proto_data)
sa->doi->free_proto_data(proto->data);
if (sa->doi && sa->doi->free_sa_data)
sa->doi->free_sa_data(sa->data);
struct doi *doi;
struct doi;
u_int32_t doi;
u_int32_t doi;
u_int32_t sit_ipsec, doi;
doi = ntohl(sp->doi);
printf(" DOI: %d", doi);
if (doi == IPSEC_DOI) {
ike_attribute_print (u_int8_t *buf, u_int8_t doi, int maxlen)
if (doi == ISAKMP_DOI)
if (doi == ISAKMP_DOI)
ike_pl_transform_print (u_int8_t *buf, int len, u_int8_t doi)
switch (doi) {
attr += ike_attribute_print(attr, doi, len - (attr - buf));
ike_pl_proposal_print (u_int8_t *buf, int len, u_int8_t doi)
doi = ISAKMP_DOI;
doi = IPSEC_DOI;
ike_pl_print(PAYLOAD_TRANSFORM, pp->spi + pp->spi_size, doi);
ike_pl_ke_print (u_int8_t *buf, int len, u_int8_t doi)
if (doi != IPSEC_DOI)
ipsec_id_print (u_int8_t *buf, int len, u_int8_t doi)
if (doi != ISAKMP_DOI)
u_int32_t doi;
doi = ntohl(dp->doi);
if (doi != ISAKMP_DOI && doi != IPSEC_DOI) {
printf(" DOI: %u(%s) proto: %s nspis: %u", doi,
doi == ISAKMP_DOI ? "ISAKMP" : "IPSEC",
u_int32_t doi;
u_int32_t doi;
doi = ntohl (np->doi);
if (doi != ISAKMP_DOI && doi != IPSEC_DOI) {
ike_pl_vendor_print (u_int8_t *buf, int len, u_int8_t doi)
if (doi != IPSEC_DOI)
ike_pl_print (u_int8_t type, u_int8_t *buf, u_int8_t doi)
ike_pl_proposal_print(buf, this_len, doi);
ike_pl_transform_print(buf, this_len, doi);
ike_pl_ke_print(buf, this_len, doi);
ipsec_id_print(buf, this_len, doi);
ike_pl_vendor_print(buf, this_len, doi);
ipsec_id_print(buf, this_len, doi);
ipsec_id_print(buf, this_len, doi);
ike_pl_print(next_type, buf + this_len, doi);
if (doi == ISAKMP_DOI)