Lines Matching defs:nl_msg

55 typedef int (*ovpn_nl_cb)(struct nl_msg *msg, void *arg);
70 struct nl_msg *nl_msg;
203 ctx->nl_msg = nlmsg_alloc();
204 if (!ctx->nl_msg) {
217 genlmsg_put(ctx->nl_msg, 0, 0, ctx->ovpn_dco_id, 0, flags, cmd, 0);
220 NLA_PUT_U32(ctx->nl_msg, OVPN_A_IFINDEX, ovpn->ifindex);
225 nlmsg_free(ctx->nl_msg);
244 nlmsg_free(ctx->nl_msg);
294 static int ovpn_nl_cb_finish(struct nl_msg (*msg)__always_unused,
303 static int ovpn_nl_cb_ack(struct nl_msg (*msg)__always_unused,
324 nl_send_auto_complete(ctx->nl_sock, ctx->nl_msg);
649 attr = nla_nest_start(ctx->nl_msg, OVPN_A_PEER);
650 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_ID, ovpn->peer_id);
651 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_SOCKET, ovpn->socket);
656 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_REMOTE_IPV4,
658 NLA_PUT_U16(ctx->nl_msg, OVPN_A_PEER_REMOTE_PORT,
662 NLA_PUT(ctx->nl_msg, OVPN_A_PEER_REMOTE_IPV6,
665 NLA_PUT_U32(ctx->nl_msg,
668 NLA_PUT_U16(ctx->nl_msg, OVPN_A_PEER_REMOTE_PORT,
681 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_VPN_IPV4,
685 NLA_PUT(ctx->nl_msg, OVPN_A_PEER_VPN_IPV6,
695 nla_nest_end(ctx->nl_msg, attr);
713 attr = nla_nest_start(ctx->nl_msg, OVPN_A_PEER);
714 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_ID, ovpn->peer_id);
715 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_KEEPALIVE_INTERVAL,
717 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_KEEPALIVE_TIMEOUT,
719 nla_nest_end(ctx->nl_msg, attr);
737 attr = nla_nest_start(ctx->nl_msg, OVPN_A_PEER);
738 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_ID, ovpn->peer_id);
739 nla_nest_end(ctx->nl_msg, attr);
747 static int ovpn_handle_peer(struct nl_msg *msg, void (*arg)__always_unused)
893 attr = nla_nest_start(ctx->nl_msg, OVPN_A_PEER);
894 NLA_PUT_U32(ctx->nl_msg, OVPN_A_PEER_ID, ovpn->peer_id);
895 nla_nest_end(ctx->nl_msg, attr);
914 keyconf = nla_nest_start(ctx->nl_msg, OVPN_A_KEYCONF);
915 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_PEER_ID, ovpn->peer_id);
916 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_SLOT, ovpn->key_slot);
917 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_KEY_ID, ovpn->key_id);
918 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_CIPHER_ALG, ovpn->cipher);
920 key_dir = nla_nest_start(ctx->nl_msg, OVPN_A_KEYCONF_ENCRYPT_DIR);
921 NLA_PUT(ctx->nl_msg, OVPN_A_KEYDIR_CIPHER_KEY, KEY_LEN, ovpn->key_enc);
922 NLA_PUT(ctx->nl_msg, OVPN_A_KEYDIR_NONCE_TAIL, NONCE_LEN, ovpn->nonce);
923 nla_nest_end(ctx->nl_msg, key_dir);
925 key_dir = nla_nest_start(ctx->nl_msg, OVPN_A_KEYCONF_DECRYPT_DIR);
926 NLA_PUT(ctx->nl_msg, OVPN_A_KEYDIR_CIPHER_KEY, KEY_LEN, ovpn->key_dec);
927 NLA_PUT(ctx->nl_msg, OVPN_A_KEYDIR_NONCE_TAIL, NONCE_LEN, ovpn->nonce);
928 nla_nest_end(ctx->nl_msg, key_dir);
930 nla_nest_end(ctx->nl_msg, keyconf);
948 keyconf = nla_nest_start(ctx->nl_msg, OVPN_A_KEYCONF);
949 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_PEER_ID, ovpn->peer_id);
950 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_SLOT, ovpn->key_slot);
951 nla_nest_end(ctx->nl_msg, keyconf);
959 static int ovpn_handle_key(struct nl_msg *msg, void (*arg)__always_unused)
1029 keyconf = nla_nest_start(ctx->nl_msg, OVPN_A_KEYCONF);
1030 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_PEER_ID, ovpn->peer_id);
1031 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_SLOT, ovpn->key_slot);
1032 nla_nest_end(ctx->nl_msg, keyconf);
1050 kc = nla_nest_start(ctx->nl_msg, OVPN_A_KEYCONF);
1051 NLA_PUT_U32(ctx->nl_msg, OVPN_A_KEYCONF_PEER_ID, ovpn->peer_id);
1052 nla_nest_end(ctx->nl_msg, kc);
1417 static int nl_seq_check(struct nl_msg (*msg)__always_unused,
1428 static int mcast_family_handler(struct nl_msg *msg, void *arg)
1470 static int mcast_ack_handler(struct nl_msg (*msg)__always_unused, void *arg)
1478 static int ovpn_handle_msg(struct nl_msg *msg, void *arg)
1533 struct nl_msg *msg;