/* Process a SADB_REGISTER message from the kernel. * This will be a response to one of ours, but it may be asynchronous * (if kernel modules are loaded and unloaded). * Some sanity checking has already been performed. */ static void klips_pfkey_register_response(const struct sadb_msg *msg) { /* Find out what the kernel can support. * In fact, the only question at the moment * is whether it can support IPcomp. * So we ignore the rest. * ??? we really should pay attention to what transforms are supported. */ switch (msg->sadb_msg_satype) { case SADB_SATYPE_AH: break; case SADB_SATYPE_ESP: #ifdef KERNEL_ALG kernel_alg_register_pfkey(msg, sizeof (pfkey_buf)); #endif break; case SADB_X_SATYPE_COMP: /* ??? There ought to be an extension to list the * supported algorithms, but RFC 2367 doesn't * list one for IPcomp. KLIPS uses SADB_X_CALG_DEFLATE. * Since we only implement deflate, we'll assume this. */ can_do_IPcomp = TRUE; break; case SADB_X_SATYPE_IPIP: break; default: break; } }
static void linux_pfkey_register_response(const struct sadb_msg *msg) { switch (msg->sadb_msg_satype) { case SADB_SATYPE_ESP: #ifdef KERNEL_ALG kernel_alg_register_pfkey(msg, msg->sadb_msg_len * IPSEC_PFKEYv2_ALIGN); #endif break; case SADB_X_SATYPE_IPCOMP: can_do_IPcomp = TRUE; break; default: break; } }