Lines Matching defs:result
939 struct mbuf *m, *result;
947 result = m;
956 m_cat(result, m);
965 m_cat(result, m);
971 m_cat(result, m);
973 if (result->m_len < sizeof(struct sadb_msg)) {
974 result = m_pullup(result,
976 if (result == NULL)
980 result->m_pkthdr.len = 0;
981 for (m = result; m; m = m->m_next)
982 result->m_pkthdr.len += m->m_len;
983 mtod(result, struct sadb_msg *)->sadb_msg_len =
984 PFKEY_UNIT64(result->m_pkthdr.len);
986 if (key_sendup_mbuf(NULL, result,
1896 struct mbuf *result = NULL, *n;
1943 if (result)
1944 m_cat(result, n);
1946 result = n;
1949 if ((result->m_flags & M_PKTHDR) != 0) {
1950 result->m_pkthdr.len = 0;
1951 for (n = result; n; n = n->m_next)
1952 result->m_pkthdr.len += n->m_len;
1955 return result;
1958 m_freem(result);
2538 struct mbuf *result = NULL, *m;
2580 result = m;
2582 result->m_pkthdr.len = 0;
2583 for (m = result; m; m = m->m_next)
2584 result->m_pkthdr.len += m->m_len;
2586 mtod(result, struct sadb_msg *)->sadb_msg_len =
2587 PFKEY_UNIT64(result->m_pkthdr.len);
2592 if (result)
2593 m_freem(result);
2740 struct mbuf *result = NULL, *m;
2745 result = m;
2752 m_cat(result, m);
2759 m_cat(result, m);
2764 m_cat(result, m);
2766 if ((result->m_flags & M_PKTHDR) == 0)
2769 if (result->m_len < sizeof(struct sadb_msg)) {
2770 result = m_pullup(result, sizeof(struct sadb_msg));
2771 if (result == NULL)
2775 result->m_pkthdr.len = 0;
2776 for (m = result; m; m = m->m_next)
2777 result->m_pkthdr.len += m->m_len;
2779 mtod(result, struct sadb_msg *)->sadb_msg_len =
2780 PFKEY_UNIT64(result->m_pkthdr.len);
2782 return result;
2785 m_freem(result);
2834 struct mbuf *result = NULL, *m;
2851 result = m;
2877 m_cat(result, m);
2887 m_cat(result, m);
2897 m_cat(result, m);
2905 m_cat(result, m);
2907 if ((result->m_flags & M_PKTHDR) == 0) {
2912 if (result->m_len < sizeof(struct sadb_msg)) {
2913 result = m_pullup(result, sizeof(struct sadb_msg));
2914 if (result == NULL) {
2920 result->m_pkthdr.len = 0;
2921 for (m = result; m; m = m->m_next)
2922 result->m_pkthdr.len += m->m_len;
2924 mtod(result, struct sadb_msg *)->sadb_msg_len =
2925 PFKEY_UNIT64(result->m_pkthdr.len);
2927 return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED);
2930 if (result)
2931 m_freem(result);
3841 struct mbuf *result = NULL, *tres = NULL, *m;
3857 result = m;
3958 m_cat(result, tres);
3960 if (result->m_len < sizeof(struct sadb_msg)) {
3961 result = m_pullup(result, sizeof(struct sadb_msg));
3962 if (result == NULL)
3966 result->m_pkthdr.len = 0;
3967 for (m = result; m; m = m->m_next)
3968 result->m_pkthdr.len += m->m_len;
3970 mtod(result, struct sadb_msg *)->sadb_msg_len =
3971 PFKEY_UNIT64(result->m_pkthdr.len);
3973 return result;
3976 m_freem(result);
4379 * The result must be of same reqid in this case.
5894 * it is caller's responsibility to free the result.
6263 struct mbuf *result = NULL, *m, *n;
6322 if (!result)
6323 result = m;
6325 m_cat(result, m);
6328 return result;
6331 if (result)
6332 m_freem(result);
6514 struct mbuf *result = NULL, *m;
6570 result = m;
6579 m_cat(result, m);
6587 m_cat(result, m);
6598 m_cat(result, m);
6656 m_cat(result, m);
6662 m_cat(result, m);
6665 if ((result->m_flags & M_PKTHDR) == 0) {
6670 if (result->m_len < sizeof(struct sadb_msg)) {
6671 result = m_pullup(result, sizeof(struct sadb_msg));
6672 if (result == NULL) {
6678 result->m_pkthdr.len = 0;
6679 for (m = result; m; m = m->m_next)
6680 result->m_pkthdr.len += m->m_len;
6682 mtod(result, struct sadb_msg *)->sadb_msg_len =
6683 PFKEY_UNIT64(result->m_pkthdr.len);
6685 return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED);
6688 if (result)
6689 m_freem(result);
7159 struct mbuf *result = NULL, *m;
7180 result = m;
7188 m_cat(result, m);
7198 m_cat(result, m);
7219 m_cat(result, m);
7229 m_cat(result, m);
7239 m_cat(result, m);
7241 if ((result->m_flags & M_PKTHDR) == 0) {
7246 if (result->m_len < sizeof(struct sadb_msg)) {
7247 result = m_pullup(result, sizeof(struct sadb_msg));
7248 if (result == NULL) {
7254 result->m_pkthdr.len = 0;
7255 for (m = result; m; m = m->m_next)
7256 result->m_pkthdr.len += m->m_len;
7258 mtod(result, struct sadb_msg *)->sadb_msg_len =
7259 PFKEY_UNIT64(result->m_pkthdr.len);
7261 return key_sendup_mbuf(NULL, result, KEY_SENDUP_REGISTERED);
7264 if (result)
7265 m_freem(result);
8341 errno_t result = 0;
8347 result = mbuf_tag_id_find(IPSECIF_CONTROL_NAME, &ipsecif_family);
8348 if (result != 0) {
8349 printf("ipsecif_register_control - mbuf_tag_id_find_internal failed: %d\n", result);
8350 return result;
8361 result = ctl_register(&kern_ctl, &ipsecif_kctlref);
8362 if (result != 0) {
8363 printf("ipsecif_register_control - ctl_register failed: %d\n", result);
8364 return result;
8368 if ((result = proto_register_plumber(PF_INET, ipsecif_family,
8371 ipsecif_family, result);
8373 return result;
8377 if ((result = proto_register_plumber(PF_INET6, ipsecif_family,
8382 ipsecif_family, result);
8383 return result;
8399 errno_t result;
8428 result = ifnet_allocate(&ipsecif_init, &pcb->ifp);
8429 if (result != 0) {
8430 printf("ipsecif_ctl_connect - ifnet_allocate failed: %d\n", result);
8432 return result;
8442 result = ifnet_attach(pcb->ifp, NULL);
8443 if (result != 0) {
8444 printf("ipsecif_ctl_connect - ifnet_allocate failed: %d\n", result);
8450 if (result == 0)
8453 return result;
8475 errno_t result = EPROTONOSUPPORT;
8485 result = sock_ioctl(pf_socket, SIOCPROTODETACH, &ifr);
8494 result = sock_ioctl(pf_socket, SIOCPROTODETACH_IN6, &ifr6);
8497 return result;
8507 errno_t result = 0;
8516 result = ifaddr_address(address, &ifr.ifr_addr, sizeof(ifr.ifr_addr));
8517 if (result != 0) {
8518 printf("ipsecif_remove_address - ifaddr_address failed: %d", result);
8521 result = sock_ioctl(pf_socket, SIOCDIFADDR, &ifr);
8522 if (result != 0) {
8523 printf("ipsecif_remove_address - SIOCDIFADDR failed: %d", result);
8533 result = ifaddr_address(address, (struct sockaddr*)&ifr6.ifr_addr,
8535 if (result != 0) {
8537 result);
8540 result = sock_ioctl(pf_socket, SIOCDIFADDR_IN6, &ifr6);
8541 if (result != 0) {
8543 result);
8554 errno_t result = 0;
8565 result = sock_socket(protocol, SOCK_DGRAM, 0, NULL, NULL, &pf_socket);
8566 if (result != 0) {
8567 if (result != EAFNOSUPPORT)
8569 protocol == PF_INET ? "IP" : "IPv6", result);
8573 result = ipsecif_detach_ip(interface, protocol, pf_socket);
8574 if (result == 0 || result == ENXIO) {
8578 else if (result != EBUSY) {
8580 printf("ipsecif_cleanup_family - ipsecif_detach_ip failed: %d\n", result);
8588 result = ifnet_get_address_list_family(interface, &addresses, protocol);
8589 if (result != 0) {
8592 protocol == PF_INET ? "PF_INET" : "PF_INET6", result);
8605 result = ipsecif_detach_ip(interface, protocol, pf_socket);
8606 if (result != 0 && result != ENXIO) {
8607 printf("ipsecif_cleanup_family - ipsecif_detach_ip failed: %d\n", result);
8626 errno_t result = 0;
8640 if ((result = ifnet_detach(ifp)) != 0) {
8641 printf("ipsecif_ctl_disconnect - ifnet_detach failed: %d\n", result);
8644 if ((result = ifnet_release(ifp)) != 0) {
8645 printf("ipsecif_ctl_disconnect - ifnet_release failed: %d\n", result);
8699 errno_t result;
8711 result = ifnet_input(pcb->ifp, m, &incs);
8712 if (result != 0) {
8714 printf("ipsecif_ctl_send - ifnet_input failed: %d\n", result);
8728 errno_t result;
8740 result = ctl_enqueuembuf(pcb->ctlref, pcb->unit, data, CTL_DATA_EOR);
8741 if (result != 0) {
8743 printf("ipsecif_output - ctl_enqueuembuf failed: %d\n", result);
8820 errno_t result = 0;
8828 result = EOPNOTSUPP;
8831 return result;
8879 errno_t result;
8884 result = ifnet_attach_protocol(interface, protocol, &proto);
8885 if (result != 0 && result != EEXIST) {
8887 protocol, result);
8890 return result;