diff --git a/home/nipa/nipa_out/1022236/ynl/old-code/ovpn-user.c b/home/nipa/nipa_out/1022236/ynl/new-code/ovpn-user.c index 249a1e947c58..956cd6c87aa5 100644 --- a/home/nipa/nipa_out/1022236/ynl/old-code/ovpn-user.c +++ b/home/nipa/nipa_out/1022236/ynl/new-code/ovpn-user.c @@ -23,6 +23,7 @@ static const char * const ovpn_op_strmap[] = { [OVPN_CMD_KEY_SWAP] = "key-swap", [OVPN_CMD_KEY_SWAP_NTF] = "key-swap-ntf", [OVPN_CMD_KEY_DEL] = "key-del", + [OVPN_CMD_PEER_FLOAT_NTF] = "peer-float-ntf", }; const char *ovpn_op_str(int op) @@ -86,6 +87,7 @@ const struct ynl_policy_attr ovpn_peer_new_input_policy[OVPN_A_PEER_MAX + 1] = { [OVPN_A_PEER_LOCAL_IPV6] = { .name = "local-ipv6", .type = YNL_PT_BINARY,}, [OVPN_A_PEER_KEEPALIVE_INTERVAL] = { .name = "keepalive-interval", .type = YNL_PT_U32, }, [OVPN_A_PEER_KEEPALIVE_TIMEOUT] = { .name = "keepalive-timeout", .type = YNL_PT_U32, }, + [OVPN_A_PEER_TX_ID] = { .name = "tx-id", .type = YNL_PT_U32, }, }; const struct ynl_policy_nest ovpn_peer_new_input_nest = { @@ -105,6 +107,7 @@ const struct ynl_policy_attr ovpn_peer_set_input_policy[OVPN_A_PEER_MAX + 1] = { [OVPN_A_PEER_LOCAL_IPV6] = { .name = "local-ipv6", .type = YNL_PT_BINARY,}, [OVPN_A_PEER_KEEPALIVE_INTERVAL] = { .name = "keepalive-interval", .type = YNL_PT_U32, }, [OVPN_A_PEER_KEEPALIVE_TIMEOUT] = { .name = "keepalive-timeout", .type = YNL_PT_U32, }, + [OVPN_A_PEER_TX_ID] = { .name = "tx-id", .type = YNL_PT_U32, }, }; const struct ynl_policy_nest ovpn_peer_set_input_nest = { @@ -136,6 +139,7 @@ const struct ynl_policy_attr ovpn_peer_policy[OVPN_A_PEER_MAX + 1] = { [OVPN_A_PEER_LINK_TX_BYTES] = { .name = "link-tx-bytes", .type = YNL_PT_UINT, }, [OVPN_A_PEER_LINK_RX_PACKETS] = { .name = "link-rx-packets", .type = YNL_PT_UINT, }, [OVPN_A_PEER_LINK_TX_PACKETS] = { .name = "link-tx-packets", .type = YNL_PT_UINT, }, + [OVPN_A_PEER_TX_ID] = { .name = "tx-id", .type = YNL_PT_U32, }, }; const struct ynl_policy_nest ovpn_peer_nest = { @@ -316,6 +320,8 @@ int ovpn_peer_new_input_put(struct nlmsghdr *nlh, unsigned int attr_type, ynl_attr_put_u32(nlh, OVPN_A_PEER_KEEPALIVE_INTERVAL, obj->keepalive_interval); if (obj->_present.keepalive_timeout) ynl_attr_put_u32(nlh, OVPN_A_PEER_KEEPALIVE_TIMEOUT, obj->keepalive_timeout); + if (obj->_present.tx_id) + ynl_attr_put_u32(nlh, OVPN_A_PEER_TX_ID, obj->tx_id); ynl_attr_nest_end(nlh, nest); return 0; @@ -356,6 +362,8 @@ int ovpn_peer_set_input_put(struct nlmsghdr *nlh, unsigned int attr_type, ynl_attr_put_u32(nlh, OVPN_A_PEER_KEEPALIVE_INTERVAL, obj->keepalive_interval); if (obj->_present.keepalive_timeout) ynl_attr_put_u32(nlh, OVPN_A_PEER_KEEPALIVE_TIMEOUT, obj->keepalive_timeout); + if (obj->_present.tx_id) + ynl_attr_put_u32(nlh, OVPN_A_PEER_TX_ID, obj->tx_id); ynl_attr_nest_end(nlh, nest); return 0; @@ -420,6 +428,8 @@ int ovpn_peer_put(struct nlmsghdr *nlh, unsigned int attr_type, ynl_attr_put_uint(nlh, OVPN_A_PEER_LINK_RX_PACKETS, obj->link_rx_packets); if (obj->_present.link_tx_packets) ynl_attr_put_uint(nlh, OVPN_A_PEER_LINK_TX_PACKETS, obj->link_tx_packets); + if (obj->_present.tx_id) + ynl_attr_put_u32(nlh, OVPN_A_PEER_TX_ID, obj->tx_id); ynl_attr_nest_end(nlh, nest); return 0; @@ -558,6 +568,11 @@ int ovpn_peer_parse(struct ynl_parse_arg *yarg, const struct nlattr *nested) return YNL_PARSE_CB_ERROR; dst->_present.link_tx_packets = 1; dst->link_tx_packets = ynl_attr_get_uint(attr); + } else if (type == OVPN_A_PEER_TX_ID) { + if (ynl_attr_validate(yarg, attr)) + return YNL_PARSE_CB_ERROR; + dst->_present.tx_id = 1; + dst->tx_id = ynl_attr_get_u32(attr); } } @@ -1135,6 +1150,12 @@ static const struct ynl_ntf_info ovpn_ntf_info[] = { .policy = &ovpn_ovpn_keyconf_get_nest, .free = (void *)ovpn_key_get_ntf_free, }, + [OVPN_CMD_PEER_FLOAT_NTF] = { + .alloc_sz = sizeof(struct ovpn_peer_get_ntf), + .cb = ovpn_peer_get_rsp_parse, + .policy = &ovpn_nest, + .free = (void *)ovpn_peer_get_ntf_free, + }, }; const struct ynl_family ynl_ovpn_family = { diff --git a/home/nipa/nipa_out/1022236/ynl/old-code/ovpn-user.h b/home/nipa/nipa_out/1022236/ynl/new-code/ovpn-user.h index 8cc2d5245063..9c1f8060607a 100644 --- a/home/nipa/nipa_out/1022236/ynl/old-code/ovpn-user.h +++ b/home/nipa/nipa_out/1022236/ynl/new-code/ovpn-user.h @@ -33,6 +33,7 @@ struct ovpn_peer_new_input { __u32 local_ipv4:1; __u32 keepalive_interval:1; __u32 keepalive_timeout:1; + __u32 tx_id:1; } _present; struct { __u32 remote_ipv6; @@ -52,6 +53,7 @@ struct ovpn_peer_new_input { void *local_ipv6; __u32 keepalive_interval; __u32 keepalive_timeout; + __u32 tx_id; }; struct ovpn_peer_set_input { @@ -64,6 +66,7 @@ struct ovpn_peer_set_input { __u32 local_ipv4:1; __u32 keepalive_interval:1; __u32 keepalive_timeout:1; + __u32 tx_id:1; } _present; struct { __u32 remote_ipv6; @@ -82,6 +85,7 @@ struct ovpn_peer_set_input { void *local_ipv6; __u32 keepalive_interval; __u32 keepalive_timeout; + __u32 tx_id; }; struct ovpn_peer { @@ -106,6 +110,7 @@ struct ovpn_peer { __u32 link_tx_bytes:1; __u32 link_rx_packets:1; __u32 link_tx_packets:1; + __u32 tx_id:1; } _present; struct { __u32 remote_ipv6; @@ -136,6 +141,7 @@ struct ovpn_peer { __u64 link_tx_bytes; __u64 link_rx_packets; __u64 link_tx_packets; + __u32 tx_id; }; struct ovpn_peer_del_input { @@ -330,6 +336,13 @@ ovpn_peer_new_req_set_peer_keepalive_timeout(struct ovpn_peer_new_req *req, req->peer._present.keepalive_timeout = 1; req->peer.keepalive_timeout = keepalive_timeout; } +static inline void +ovpn_peer_new_req_set_peer_tx_id(struct ovpn_peer_new_req *req, __u32 tx_id) +{ + req->_present.peer = 1; + req->peer._present.tx_id = 1; + req->peer.tx_id = tx_id; +} /* * Add a remote peer @@ -453,6 +466,13 @@ ovpn_peer_set_req_set_peer_keepalive_timeout(struct ovpn_peer_set_req *req, req->peer._present.keepalive_timeout = 1; req->peer.keepalive_timeout = keepalive_timeout; } +static inline void +ovpn_peer_set_req_set_peer_tx_id(struct ovpn_peer_set_req *req, __u32 tx_id) +{ + req->_present.peer = 1; + req->peer._present.tx_id = 1; + req->peer.tx_id = tx_id; +} /* * modify a remote peer @@ -671,6 +691,13 @@ ovpn_peer_get_req_set_peer_link_tx_packets(struct ovpn_peer_get_req *req, req->peer._present.link_tx_packets = 1; req->peer.link_tx_packets = link_tx_packets; } +static inline void +ovpn_peer_get_req_set_peer_tx_id(struct ovpn_peer_get_req *req, __u32 tx_id) +{ + req->_present.peer = 1; + req->peer._present.tx_id = 1; + req->peer.tx_id = tx_id; +} struct ovpn_peer_get_rsp { struct {