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