return 0;
int rval = 0; int i; u_int8_t satype; void *p, *headers[SADB_EXT_MAX+1], *buffer;  switch (sa->tdb_sproto) { case IPPROTO_AH: satype = sa->tdb_xform->xf_type == XF_OLD_AH ? SADB_SATYPE_X_AH_OLD : SADB_SATYPE_AH; break; case IPPROTO_ESP: satype = sa->tdb_xform->xf_type == XF_OLD_ESP ? SADB_SATYPE_X_ESP_OLD : SADB_SATYPE_ESP; break; case IPPROTO_IPIP: satype = SADB_SATYPE_X_IPIP; break; default: rval = EOPNOTSUPP; goto ret; }  i = sizeof(struct sadb_msg) + sizeof(struct sadb_sa) + 2 * sizeof(struct sadb_lifetime) + sizeof(struct sadb_address) + PADUP(SA_LEN(&sa->tdb_src.sa)) + sizeof(struct sadb_address) + PADUP(SA_LEN(&sa->tdb_dst.sa));  if (!(p = malloc(i, M_TEMP, M_DONTWAIT))) { rval = ENOMEM; goto ret; }  bzero(headers, sizeof(headers));  buffer = p; bzero(p, i);  headers[0] = p; p += sizeof(struct sadb_msg); ((struct sadb_msg *)headers[0])->sadb_msg_version = PF_KEY_V2; ((struct sadb_msg *)headers[0])->sadb_msg_type    = SADB_EXPIRE; ((struct sadb_msg *)headers[0])->sadb_msg_satype  = satype; ((struct sadb_msg *)headers[0])->sadb_msg_len     = i / sizeof(uint64_t); ((struct sadb_msg *)headers[0])->sadb_msg_seq     = pfkeyv2_seq++;  headers[SADB_EXT_SA] = p; export_sa(&p, sa);  headers[SADB_EXT_LIFETIME_CURRENT] = p; export_lifetime(&p, sa, 2);  headers[type] = p; export_lifetime(&p, sa, type == SADB_EXT_LIFETIME_SOFT ? 1 : 0);  headers[SADB_EXT_ADDRESS_SRC] = p; export_address(&p, (struct sockaddr *)&sa->tdb_src);  headers[SADB_EXT_ADDRESS_DST] = p; export_address(&p, (struct sockaddr *)&sa->tdb_dst);  if ((rval = pfkeyv2_sendmessage(headers, PFKEYV2_SENDMESSAGE_BROADCAST, NULL, 0, 0))!= 0) goto ret;  rval = 0;  ret: return rval;
pfkeyv2_expire(struct tdb *sa){  /* XXX missing */  return 0;}