/src/systemd/src/libsystemd-network/dhcp-route.c
Line | Count | Source |
1 | | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
2 | | |
3 | | #include "sd-dhcp-lease.h" |
4 | | |
5 | | #include "dhcp-route.h" |
6 | | |
7 | 0 | int sd_dhcp_route_get_destination(sd_dhcp_route *route, struct in_addr *ret) { |
8 | 0 | assert_return(route, -EINVAL); |
9 | 0 | assert_return(ret, -EINVAL); |
10 | | |
11 | 0 | *ret = route->dst_addr; |
12 | 0 | return 0; |
13 | 0 | } |
14 | | |
15 | 0 | int sd_dhcp_route_get_destination_prefix_length(sd_dhcp_route *route, uint8_t *ret) { |
16 | 0 | assert_return(route, -EINVAL); |
17 | 0 | assert_return(ret, -EINVAL); |
18 | | |
19 | 0 | *ret = route->dst_prefixlen; |
20 | 0 | return 0; |
21 | 0 | } |
22 | | |
23 | 0 | int sd_dhcp_route_get_gateway(sd_dhcp_route *route, struct in_addr *ret) { |
24 | 0 | assert_return(route, -EINVAL); |
25 | 0 | assert_return(ret, -EINVAL); |
26 | | |
27 | 0 | *ret = route->gw_addr; |
28 | 0 | return 0; |
29 | 0 | } |