17a11f70cSJakub Kicinski // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
27a11f70cSJakub Kicinski /* Do not edit directly, auto-generated from: */
37a11f70cSJakub Kicinski /* Documentation/netlink/specs/handshake.yaml */
47a11f70cSJakub Kicinski /* YNL-GEN user source */
57a11f70cSJakub Kicinski
67a11f70cSJakub Kicinski #include <stdlib.h>
79b52fd4bSJakub Kicinski #include <string.h>
87a11f70cSJakub Kicinski #include "handshake-user.h"
97a11f70cSJakub Kicinski #include "ynl.h"
107a11f70cSJakub Kicinski #include <linux/handshake.h>
117a11f70cSJakub Kicinski
127a11f70cSJakub Kicinski #include <libmnl/libmnl.h>
137a11f70cSJakub Kicinski #include <linux/genetlink.h>
147a11f70cSJakub Kicinski
157a11f70cSJakub Kicinski /* Enums */
167a11f70cSJakub Kicinski static const char * const handshake_op_strmap[] = {
177a11f70cSJakub Kicinski [HANDSHAKE_CMD_READY] = "ready",
187a11f70cSJakub Kicinski [HANDSHAKE_CMD_ACCEPT] = "accept",
197a11f70cSJakub Kicinski [HANDSHAKE_CMD_DONE] = "done",
207a11f70cSJakub Kicinski };
217a11f70cSJakub Kicinski
handshake_op_str(int op)227a11f70cSJakub Kicinski const char *handshake_op_str(int op)
237a11f70cSJakub Kicinski {
247a11f70cSJakub Kicinski if (op < 0 || op >= (int)MNL_ARRAY_SIZE(handshake_op_strmap))
257a11f70cSJakub Kicinski return NULL;
267a11f70cSJakub Kicinski return handshake_op_strmap[op];
277a11f70cSJakub Kicinski }
287a11f70cSJakub Kicinski
297a11f70cSJakub Kicinski static const char * const handshake_handler_class_strmap[] = {
307a11f70cSJakub Kicinski [0] = "none",
317a11f70cSJakub Kicinski [1] = "tlshd",
327a11f70cSJakub Kicinski [2] = "max",
337a11f70cSJakub Kicinski };
347a11f70cSJakub Kicinski
handshake_handler_class_str(enum handshake_handler_class value)357a11f70cSJakub Kicinski const char *handshake_handler_class_str(enum handshake_handler_class value)
367a11f70cSJakub Kicinski {
377a11f70cSJakub Kicinski if (value < 0 || value >= (int)MNL_ARRAY_SIZE(handshake_handler_class_strmap))
387a11f70cSJakub Kicinski return NULL;
397a11f70cSJakub Kicinski return handshake_handler_class_strmap[value];
407a11f70cSJakub Kicinski }
417a11f70cSJakub Kicinski
427a11f70cSJakub Kicinski static const char * const handshake_msg_type_strmap[] = {
437a11f70cSJakub Kicinski [0] = "unspec",
447a11f70cSJakub Kicinski [1] = "clienthello",
457a11f70cSJakub Kicinski [2] = "serverhello",
467a11f70cSJakub Kicinski };
477a11f70cSJakub Kicinski
handshake_msg_type_str(enum handshake_msg_type value)487a11f70cSJakub Kicinski const char *handshake_msg_type_str(enum handshake_msg_type value)
497a11f70cSJakub Kicinski {
507a11f70cSJakub Kicinski if (value < 0 || value >= (int)MNL_ARRAY_SIZE(handshake_msg_type_strmap))
517a11f70cSJakub Kicinski return NULL;
527a11f70cSJakub Kicinski return handshake_msg_type_strmap[value];
537a11f70cSJakub Kicinski }
547a11f70cSJakub Kicinski
557a11f70cSJakub Kicinski static const char * const handshake_auth_strmap[] = {
567a11f70cSJakub Kicinski [0] = "unspec",
577a11f70cSJakub Kicinski [1] = "unauth",
587a11f70cSJakub Kicinski [2] = "psk",
597a11f70cSJakub Kicinski [3] = "x509",
607a11f70cSJakub Kicinski };
617a11f70cSJakub Kicinski
handshake_auth_str(enum handshake_auth value)627a11f70cSJakub Kicinski const char *handshake_auth_str(enum handshake_auth value)
637a11f70cSJakub Kicinski {
647a11f70cSJakub Kicinski if (value < 0 || value >= (int)MNL_ARRAY_SIZE(handshake_auth_strmap))
657a11f70cSJakub Kicinski return NULL;
667a11f70cSJakub Kicinski return handshake_auth_strmap[value];
677a11f70cSJakub Kicinski }
687a11f70cSJakub Kicinski
697a11f70cSJakub Kicinski /* Policies */
707a11f70cSJakub Kicinski struct ynl_policy_attr handshake_x509_policy[HANDSHAKE_A_X509_MAX + 1] = {
717a11f70cSJakub Kicinski [HANDSHAKE_A_X509_CERT] = { .name = "cert", .type = YNL_PT_U32, },
727a11f70cSJakub Kicinski [HANDSHAKE_A_X509_PRIVKEY] = { .name = "privkey", .type = YNL_PT_U32, },
737a11f70cSJakub Kicinski };
747a11f70cSJakub Kicinski
757a11f70cSJakub Kicinski struct ynl_policy_nest handshake_x509_nest = {
767a11f70cSJakub Kicinski .max_attr = HANDSHAKE_A_X509_MAX,
777a11f70cSJakub Kicinski .table = handshake_x509_policy,
787a11f70cSJakub Kicinski };
797a11f70cSJakub Kicinski
807a11f70cSJakub Kicinski struct ynl_policy_attr handshake_accept_policy[HANDSHAKE_A_ACCEPT_MAX + 1] = {
817a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_SOCKFD] = { .name = "sockfd", .type = YNL_PT_U32, },
827a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_HANDLER_CLASS] = { .name = "handler-class", .type = YNL_PT_U32, },
837a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_MESSAGE_TYPE] = { .name = "message-type", .type = YNL_PT_U32, },
847a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_TIMEOUT] = { .name = "timeout", .type = YNL_PT_U32, },
857a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_AUTH_MODE] = { .name = "auth-mode", .type = YNL_PT_U32, },
867a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_PEER_IDENTITY] = { .name = "peer-identity", .type = YNL_PT_U32, },
877a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_CERTIFICATE] = { .name = "certificate", .type = YNL_PT_NEST, .nest = &handshake_x509_nest, },
887a11f70cSJakub Kicinski [HANDSHAKE_A_ACCEPT_PEERNAME] = { .name = "peername", .type = YNL_PT_NUL_STR, },
897a11f70cSJakub Kicinski };
907a11f70cSJakub Kicinski
917a11f70cSJakub Kicinski struct ynl_policy_nest handshake_accept_nest = {
927a11f70cSJakub Kicinski .max_attr = HANDSHAKE_A_ACCEPT_MAX,
937a11f70cSJakub Kicinski .table = handshake_accept_policy,
947a11f70cSJakub Kicinski };
957a11f70cSJakub Kicinski
967a11f70cSJakub Kicinski struct ynl_policy_attr handshake_done_policy[HANDSHAKE_A_DONE_MAX + 1] = {
977a11f70cSJakub Kicinski [HANDSHAKE_A_DONE_STATUS] = { .name = "status", .type = YNL_PT_U32, },
987a11f70cSJakub Kicinski [HANDSHAKE_A_DONE_SOCKFD] = { .name = "sockfd", .type = YNL_PT_U32, },
997a11f70cSJakub Kicinski [HANDSHAKE_A_DONE_REMOTE_AUTH] = { .name = "remote-auth", .type = YNL_PT_U32, },
1007a11f70cSJakub Kicinski };
1017a11f70cSJakub Kicinski
1027a11f70cSJakub Kicinski struct ynl_policy_nest handshake_done_nest = {
1037a11f70cSJakub Kicinski .max_attr = HANDSHAKE_A_DONE_MAX,
1047a11f70cSJakub Kicinski .table = handshake_done_policy,
1057a11f70cSJakub Kicinski };
1067a11f70cSJakub Kicinski
1077a11f70cSJakub Kicinski /* Common nested types */
handshake_x509_free(struct handshake_x509 * obj)1087a11f70cSJakub Kicinski void handshake_x509_free(struct handshake_x509 *obj)
1097a11f70cSJakub Kicinski {
1107a11f70cSJakub Kicinski }
1117a11f70cSJakub Kicinski
handshake_x509_parse(struct ynl_parse_arg * yarg,const struct nlattr * nested)1127a11f70cSJakub Kicinski int handshake_x509_parse(struct ynl_parse_arg *yarg,
1137a11f70cSJakub Kicinski const struct nlattr *nested)
1147a11f70cSJakub Kicinski {
1157a11f70cSJakub Kicinski struct handshake_x509 *dst = yarg->data;
1167a11f70cSJakub Kicinski const struct nlattr *attr;
1177a11f70cSJakub Kicinski
1187a11f70cSJakub Kicinski mnl_attr_for_each_nested(attr, nested) {
119*7234415bSJakub Kicinski unsigned int type = mnl_attr_get_type(attr);
120*7234415bSJakub Kicinski
121*7234415bSJakub Kicinski if (type == HANDSHAKE_A_X509_CERT) {
1227a11f70cSJakub Kicinski if (ynl_attr_validate(yarg, attr))
1237a11f70cSJakub Kicinski return MNL_CB_ERROR;
1247a11f70cSJakub Kicinski dst->_present.cert = 1;
1257a11f70cSJakub Kicinski dst->cert = mnl_attr_get_u32(attr);
126*7234415bSJakub Kicinski } else if (type == HANDSHAKE_A_X509_PRIVKEY) {
1277a11f70cSJakub Kicinski if (ynl_attr_validate(yarg, attr))
1287a11f70cSJakub Kicinski return MNL_CB_ERROR;
1297a11f70cSJakub Kicinski dst->_present.privkey = 1;
1307a11f70cSJakub Kicinski dst->privkey = mnl_attr_get_u32(attr);
1317a11f70cSJakub Kicinski }
1327a11f70cSJakub Kicinski }
1337a11f70cSJakub Kicinski
1347a11f70cSJakub Kicinski return 0;
1357a11f70cSJakub Kicinski }
1367a11f70cSJakub Kicinski
1377a11f70cSJakub Kicinski /* ============== HANDSHAKE_CMD_ACCEPT ============== */
1387a11f70cSJakub Kicinski /* HANDSHAKE_CMD_ACCEPT - do */
handshake_accept_req_free(struct handshake_accept_req * req)1397a11f70cSJakub Kicinski void handshake_accept_req_free(struct handshake_accept_req *req)
1407a11f70cSJakub Kicinski {
1417a11f70cSJakub Kicinski free(req);
1427a11f70cSJakub Kicinski }
1437a11f70cSJakub Kicinski
handshake_accept_rsp_free(struct handshake_accept_rsp * rsp)1447a11f70cSJakub Kicinski void handshake_accept_rsp_free(struct handshake_accept_rsp *rsp)
1457a11f70cSJakub Kicinski {
1467a11f70cSJakub Kicinski unsigned int i;
1477a11f70cSJakub Kicinski
1487a11f70cSJakub Kicinski free(rsp->peer_identity);
1497a11f70cSJakub Kicinski for (i = 0; i < rsp->n_certificate; i++)
1507a11f70cSJakub Kicinski handshake_x509_free(&rsp->certificate[i]);
1517a11f70cSJakub Kicinski free(rsp->certificate);
1527a11f70cSJakub Kicinski free(rsp->peername);
1537a11f70cSJakub Kicinski free(rsp);
1547a11f70cSJakub Kicinski }
1557a11f70cSJakub Kicinski
handshake_accept_rsp_parse(const struct nlmsghdr * nlh,void * data)1567a11f70cSJakub Kicinski int handshake_accept_rsp_parse(const struct nlmsghdr *nlh, void *data)
1577a11f70cSJakub Kicinski {
1587a11f70cSJakub Kicinski struct ynl_parse_arg *yarg = data;
1597a11f70cSJakub Kicinski struct handshake_accept_rsp *dst;
1607a11f70cSJakub Kicinski unsigned int n_peer_identity = 0;
1617a11f70cSJakub Kicinski unsigned int n_certificate = 0;
1627a11f70cSJakub Kicinski const struct nlattr *attr;
1637a11f70cSJakub Kicinski struct ynl_parse_arg parg;
1647a11f70cSJakub Kicinski int i;
1657a11f70cSJakub Kicinski
1667a11f70cSJakub Kicinski dst = yarg->data;
1677a11f70cSJakub Kicinski parg.ys = yarg->ys;
1687a11f70cSJakub Kicinski
1697a11f70cSJakub Kicinski if (dst->certificate)
1707a11f70cSJakub Kicinski return ynl_error_parse(yarg, "attribute already present (accept.certificate)");
1717a11f70cSJakub Kicinski if (dst->peer_identity)
1727a11f70cSJakub Kicinski return ynl_error_parse(yarg, "attribute already present (accept.peer-identity)");
1737a11f70cSJakub Kicinski
1747a11f70cSJakub Kicinski mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
175*7234415bSJakub Kicinski unsigned int type = mnl_attr_get_type(attr);
176*7234415bSJakub Kicinski
177*7234415bSJakub Kicinski if (type == HANDSHAKE_A_ACCEPT_SOCKFD) {
1787a11f70cSJakub Kicinski if (ynl_attr_validate(yarg, attr))
1797a11f70cSJakub Kicinski return MNL_CB_ERROR;
1807a11f70cSJakub Kicinski dst->_present.sockfd = 1;
1817a11f70cSJakub Kicinski dst->sockfd = mnl_attr_get_u32(attr);
182*7234415bSJakub Kicinski } else if (type == HANDSHAKE_A_ACCEPT_MESSAGE_TYPE) {
1837a11f70cSJakub Kicinski if (ynl_attr_validate(yarg, attr))
1847a11f70cSJakub Kicinski return MNL_CB_ERROR;
1857a11f70cSJakub Kicinski dst->_present.message_type = 1;
1867a11f70cSJakub Kicinski dst->message_type = mnl_attr_get_u32(attr);
187*7234415bSJakub Kicinski } else if (type == HANDSHAKE_A_ACCEPT_TIMEOUT) {
1887a11f70cSJakub Kicinski if (ynl_attr_validate(yarg, attr))
1897a11f70cSJakub Kicinski return MNL_CB_ERROR;
1907a11f70cSJakub Kicinski dst->_present.timeout = 1;
1917a11f70cSJakub Kicinski dst->timeout = mnl_attr_get_u32(attr);
192*7234415bSJakub Kicinski } else if (type == HANDSHAKE_A_ACCEPT_AUTH_MODE) {
1937a11f70cSJakub Kicinski if (ynl_attr_validate(yarg, attr))
1947a11f70cSJakub Kicinski return MNL_CB_ERROR;
1957a11f70cSJakub Kicinski dst->_present.auth_mode = 1;
1967a11f70cSJakub Kicinski dst->auth_mode = mnl_attr_get_u32(attr);
197*7234415bSJakub Kicinski } else if (type == HANDSHAKE_A_ACCEPT_PEER_IDENTITY) {
1987a11f70cSJakub Kicinski n_peer_identity++;
199*7234415bSJakub Kicinski } else if (type == HANDSHAKE_A_ACCEPT_CERTIFICATE) {
2007a11f70cSJakub Kicinski n_certificate++;
201*7234415bSJakub Kicinski } else if (type == HANDSHAKE_A_ACCEPT_PEERNAME) {
2027a11f70cSJakub Kicinski unsigned int len;
2037a11f70cSJakub Kicinski
2047a11f70cSJakub Kicinski if (ynl_attr_validate(yarg, attr))
2057a11f70cSJakub Kicinski return MNL_CB_ERROR;
2067a11f70cSJakub Kicinski
2077a11f70cSJakub Kicinski len = strnlen(mnl_attr_get_str(attr), mnl_attr_get_payload_len(attr));
2087a11f70cSJakub Kicinski dst->_present.peername_len = len;
2097a11f70cSJakub Kicinski dst->peername = malloc(len + 1);
2107a11f70cSJakub Kicinski memcpy(dst->peername, mnl_attr_get_str(attr), len);
2117a11f70cSJakub Kicinski dst->peername[len] = 0;
2127a11f70cSJakub Kicinski }
2137a11f70cSJakub Kicinski }
2147a11f70cSJakub Kicinski
2157a11f70cSJakub Kicinski if (n_certificate) {
2167a11f70cSJakub Kicinski dst->certificate = calloc(n_certificate, sizeof(*dst->certificate));
2177a11f70cSJakub Kicinski dst->n_certificate = n_certificate;
2187a11f70cSJakub Kicinski i = 0;
2197a11f70cSJakub Kicinski parg.rsp_policy = &handshake_x509_nest;
2207a11f70cSJakub Kicinski mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
2217a11f70cSJakub Kicinski if (mnl_attr_get_type(attr) == HANDSHAKE_A_ACCEPT_CERTIFICATE) {
2227a11f70cSJakub Kicinski parg.data = &dst->certificate[i];
2237a11f70cSJakub Kicinski if (handshake_x509_parse(&parg, attr))
2247a11f70cSJakub Kicinski return MNL_CB_ERROR;
2257a11f70cSJakub Kicinski i++;
2267a11f70cSJakub Kicinski }
2277a11f70cSJakub Kicinski }
2287a11f70cSJakub Kicinski }
2297a11f70cSJakub Kicinski if (n_peer_identity) {
2307a11f70cSJakub Kicinski dst->peer_identity = calloc(n_peer_identity, sizeof(*dst->peer_identity));
2317a11f70cSJakub Kicinski dst->n_peer_identity = n_peer_identity;
2327a11f70cSJakub Kicinski i = 0;
2337a11f70cSJakub Kicinski mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
2347a11f70cSJakub Kicinski if (mnl_attr_get_type(attr) == HANDSHAKE_A_ACCEPT_PEER_IDENTITY) {
2357a11f70cSJakub Kicinski dst->peer_identity[i] = mnl_attr_get_u32(attr);
2367a11f70cSJakub Kicinski i++;
2377a11f70cSJakub Kicinski }
2387a11f70cSJakub Kicinski }
2397a11f70cSJakub Kicinski }
2407a11f70cSJakub Kicinski
2417a11f70cSJakub Kicinski return MNL_CB_OK;
2427a11f70cSJakub Kicinski }
2437a11f70cSJakub Kicinski
2447a11f70cSJakub Kicinski struct handshake_accept_rsp *
handshake_accept(struct ynl_sock * ys,struct handshake_accept_req * req)2457a11f70cSJakub Kicinski handshake_accept(struct ynl_sock *ys, struct handshake_accept_req *req)
2467a11f70cSJakub Kicinski {
2477a11f70cSJakub Kicinski struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
2487a11f70cSJakub Kicinski struct handshake_accept_rsp *rsp;
2497a11f70cSJakub Kicinski struct nlmsghdr *nlh;
2507a11f70cSJakub Kicinski int err;
2517a11f70cSJakub Kicinski
2527a11f70cSJakub Kicinski nlh = ynl_gemsg_start_req(ys, ys->family_id, HANDSHAKE_CMD_ACCEPT, 1);
2537a11f70cSJakub Kicinski ys->req_policy = &handshake_accept_nest;
2547a11f70cSJakub Kicinski yrs.yarg.rsp_policy = &handshake_accept_nest;
2557a11f70cSJakub Kicinski
2567a11f70cSJakub Kicinski if (req->_present.handler_class)
2577a11f70cSJakub Kicinski mnl_attr_put_u32(nlh, HANDSHAKE_A_ACCEPT_HANDLER_CLASS, req->handler_class);
2587a11f70cSJakub Kicinski
2597a11f70cSJakub Kicinski rsp = calloc(1, sizeof(*rsp));
2607a11f70cSJakub Kicinski yrs.yarg.data = rsp;
2617a11f70cSJakub Kicinski yrs.cb = handshake_accept_rsp_parse;
2627a11f70cSJakub Kicinski yrs.rsp_cmd = HANDSHAKE_CMD_ACCEPT;
2637a11f70cSJakub Kicinski
2647a11f70cSJakub Kicinski err = ynl_exec(ys, nlh, &yrs);
2657a11f70cSJakub Kicinski if (err < 0)
2667a11f70cSJakub Kicinski goto err_free;
2677a11f70cSJakub Kicinski
2687a11f70cSJakub Kicinski return rsp;
2697a11f70cSJakub Kicinski
2707a11f70cSJakub Kicinski err_free:
2717a11f70cSJakub Kicinski handshake_accept_rsp_free(rsp);
2727a11f70cSJakub Kicinski return NULL;
2737a11f70cSJakub Kicinski }
2747a11f70cSJakub Kicinski
2757a11f70cSJakub Kicinski /* HANDSHAKE_CMD_ACCEPT - notify */
handshake_accept_ntf_free(struct handshake_accept_ntf * rsp)2767a11f70cSJakub Kicinski void handshake_accept_ntf_free(struct handshake_accept_ntf *rsp)
2777a11f70cSJakub Kicinski {
2787a11f70cSJakub Kicinski unsigned int i;
2797a11f70cSJakub Kicinski
2807a11f70cSJakub Kicinski free(rsp->obj.peer_identity);
2817a11f70cSJakub Kicinski for (i = 0; i < rsp->obj.n_certificate; i++)
2827a11f70cSJakub Kicinski handshake_x509_free(&rsp->obj.certificate[i]);
2837a11f70cSJakub Kicinski free(rsp->obj.certificate);
2847a11f70cSJakub Kicinski free(rsp->obj.peername);
2857a11f70cSJakub Kicinski free(rsp);
2867a11f70cSJakub Kicinski }
2877a11f70cSJakub Kicinski
2887a11f70cSJakub Kicinski /* ============== HANDSHAKE_CMD_DONE ============== */
2897a11f70cSJakub Kicinski /* HANDSHAKE_CMD_DONE - do */
handshake_done_req_free(struct handshake_done_req * req)2907a11f70cSJakub Kicinski void handshake_done_req_free(struct handshake_done_req *req)
2917a11f70cSJakub Kicinski {
2927a11f70cSJakub Kicinski free(req->remote_auth);
2937a11f70cSJakub Kicinski free(req);
2947a11f70cSJakub Kicinski }
2957a11f70cSJakub Kicinski
handshake_done(struct ynl_sock * ys,struct handshake_done_req * req)2967a11f70cSJakub Kicinski int handshake_done(struct ynl_sock *ys, struct handshake_done_req *req)
2977a11f70cSJakub Kicinski {
2987a11f70cSJakub Kicinski struct nlmsghdr *nlh;
2997a11f70cSJakub Kicinski int err;
3007a11f70cSJakub Kicinski
3017a11f70cSJakub Kicinski nlh = ynl_gemsg_start_req(ys, ys->family_id, HANDSHAKE_CMD_DONE, 1);
3027a11f70cSJakub Kicinski ys->req_policy = &handshake_done_nest;
3037a11f70cSJakub Kicinski
3047a11f70cSJakub Kicinski if (req->_present.status)
3057a11f70cSJakub Kicinski mnl_attr_put_u32(nlh, HANDSHAKE_A_DONE_STATUS, req->status);
3067a11f70cSJakub Kicinski if (req->_present.sockfd)
3077a11f70cSJakub Kicinski mnl_attr_put_u32(nlh, HANDSHAKE_A_DONE_SOCKFD, req->sockfd);
3087a11f70cSJakub Kicinski for (unsigned int i = 0; i < req->n_remote_auth; i++)
3097a11f70cSJakub Kicinski mnl_attr_put_u32(nlh, HANDSHAKE_A_DONE_REMOTE_AUTH, req->remote_auth[i]);
3107a11f70cSJakub Kicinski
3117a11f70cSJakub Kicinski err = ynl_exec(ys, nlh, NULL);
3127a11f70cSJakub Kicinski if (err < 0)
3137a11f70cSJakub Kicinski return -1;
3147a11f70cSJakub Kicinski
3157a11f70cSJakub Kicinski return 0;
3167a11f70cSJakub Kicinski }
3177a11f70cSJakub Kicinski
3187a11f70cSJakub Kicinski static const struct ynl_ntf_info handshake_ntf_info[] = {
3197a11f70cSJakub Kicinski [HANDSHAKE_CMD_READY] = {
3207a11f70cSJakub Kicinski .alloc_sz = sizeof(struct handshake_accept_ntf),
3217a11f70cSJakub Kicinski .cb = handshake_accept_rsp_parse,
3227a11f70cSJakub Kicinski .policy = &handshake_accept_nest,
3237a11f70cSJakub Kicinski .free = (void *)handshake_accept_ntf_free,
3247a11f70cSJakub Kicinski },
3257a11f70cSJakub Kicinski };
3267a11f70cSJakub Kicinski
3277a11f70cSJakub Kicinski const struct ynl_family ynl_handshake_family = {
3287a11f70cSJakub Kicinski .name = "handshake",
3297a11f70cSJakub Kicinski .ntf_info = handshake_ntf_info,
3307a11f70cSJakub Kicinski .ntf_info_size = MNL_ARRAY_SIZE(handshake_ntf_info),
3317a11f70cSJakub Kicinski };
332