break; #endif  #ifdef USE_ISAKMP_CFG case ISAKMP_EXCH_TRANSACTION: script = isakmp_cfg_responder;
ipsec_responder (struct message *msg){  struct exchange *exchange = msg->exchange;  int (**script) (struct message *msg) = 0;  struct payload *p;  u_int16_t type;  /* Check that a new exchange is coherent with the IKE rules.  */  if (exchange->step == 0      && ((exchange->phase == 1 && exchange->type != ISAKMP_EXCH_ID_PROT	   && exchange->type != ISAKMP_EXCH_AGGRESSIVE	   && exchange->type != ISAKMP_EXCH_INFO)	  || (exchange->phase == 2 && exchange->type == ISAKMP_EXCH_ID_PROT)))    {      message_drop (msg, ISAKMP_NOTIFY_UNSUPPORTED_EXCHANGE_TYPE, 0, 1, 0);      return -1;    }  LOG_DBG ((LOG_MISC, 30,	    "ipsec_responder: phase %d exchange %d step %d", exchange->phase,	    exchange->type, exchange->step));  switch (exchange->type)    {    case ISAKMP_EXCH_ID_PROT:      script = ike_main_mode_responder;      break;#ifdef USE_AGGRESSIVE    case ISAKMP_EXCH_AGGRESSIVE:      script = ike_aggressive_responder;      break;#endif    case ISAKMP_EXCH_INFO:      for (p = TAILQ_FIRST (&msg->payload[ISAKMP_PAYLOAD_NOTIFY]); p;	   p = TAILQ_NEXT (p, link))	{          type = GET_ISAKMP_NOTIFY_MSG_TYPE (p->p);	  LOG_DBG ((LOG_EXCHANGE, 10,		    "ipsec_responder: got NOTIFY of type %s",		    constant_lookup (isakmp_notify_cst, type)));          if (type == ISAKMP_NOTIFY_INVALID_SPI)              ipsec_invalid_spi (msg, p);	  p->flags |= PL_MARK;	}      /*       * If any DELETEs are in here, let the logic of leftover payloads deal       * with them.       */      return 0;    case IKE_EXCH_QUICK_MODE:      script = ike_quick_mode_responder;      break;    default:      message_drop (msg, ISAKMP_NOTIFY_UNSUPPORTED_EXCHANGE_TYPE, 0, 1, 0);      return -1;    }  /* Run the script code for this step.  */  if (script)    return script[exchange->step] (msg);  /*   * XXX So far we don't accept any proposals for exchanges we don't support.   */  if (TAILQ_FIRST (&msg->payload[ISAKMP_PAYLOAD_SA]))    {      message_drop (msg, ISAKMP_NOTIFY_NO_PROPOSAL_CHOSEN, 0, 1, 0);      return -1;    }  return 0;}