Add netlink-based cache upcall support for the ip_map (auth.unix.ip) cache, using the sunrpc generic netlink family. Add ip-map attribute-set (seqno, class, addr, domain, negative, expiry), ip-map-reqs wrapper, and ip-map-get-reqs / ip-map-set-reqs operations to the sunrpc_cache YAML spec and generated headers. Implement sunrpc_nl_ip_map_get_reqs_dumpit() which snapshots pending ip_map cache requests and sends each entry's seqno, class name, and IP address over netlink. Implement sunrpc_nl_ip_map_set_reqs_doit() which parses ip_map cache responses from userspace (class, addr, expiry, and domain name or negative flag) and updates the cache via __ip_map_lookup() / __ip_map_update(). Wire up ip_map_notify() callback in ip_map_cache_template so cache misses trigger SUNRPC_CMD_CACHE_NOTIFY multicast events with SUNRPC_CACHE_TYPE_IP_MAP.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -22,8 +22,29 @@ enum { · 21 unmodified lines | ||
| 22 | 22 | SUNRPC_A_CACHE_NOTIFY_MAX = (__SUNRPC_A_CACHE_NOTIFY_MAX - 1) |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | +enum { | |
| 26 | + SUNRPC_A_IP_MAP_SEQNO = 1, | |
| 27 | + SUNRPC_A_IP_MAP_CLASS, | |
| 28 | + SUNRPC_A_IP_MAP_ADDR, | |
| 29 | + SUNRPC_A_IP_MAP_DOMAIN, | |
| 30 | + SUNRPC_A_IP_MAP_NEGATIVE, | |
| 31 | + SUNRPC_A_IP_MAP_EXPIRY, | |
| 32 | + | |
| 33 | + __SUNRPC_A_IP_MAP_MAX, | |
| 34 | + SUNRPC_A_IP_MAP_MAX = (__SUNRPC_A_IP_MAP_MAX - 1) | |
| 35 | +}; | |
| 36 | + | |
| 37 | +enum { | |
| 38 | + SUNRPC_A_IP_MAP_REQS_REQUESTS = 1, | |
| 39 | + | |
| 40 | + __SUNRPC_A_IP_MAP_REQS_MAX, | |
| 41 | + SUNRPC_A_IP_MAP_REQS_MAX = (__SUNRPC_A_IP_MAP_REQS_MAX - 1) | |
| 42 | +}; | |
| 43 | + | |
| 25 | 44 | enum { |
| 26 | 45 | SUNRPC_CMD_CACHE_NOTIFY = 1, |
| 46 | + SUNRPC_CMD_IP_MAP_GET_REQS, | |
| 47 | + SUNRPC_CMD_IP_MAP_SET_REQS, | |
| 27 | 48 | |
| 28 | 49 | __SUNRPC_CMD_MAX, |
| 29 | 50 | SUNRPC_CMD_MAX = (__SUNRPC_CMD_MAX - 1) |