aboutsummaryrefslogtreecommitdiffstats
path: root/common.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Allow /32 and /128 to be omitted in ip= keysThomas Gschwantner2019-12-111-12/+15
|
* Properly send and display wg_errno and errmsgThomas Gschwantner2019-12-111-4/+5
|
* Change request_ip protocolThomas Gschwantner2019-12-111-20/+14
| | | | | | | | | | | | | | ipv4 and ipv6 keys have been combined into one common key, ip. To distinguish between multiple IPs in later versions ip=0.0.0.0/32 and ip=::/128 respectively now mean we want to be assigned a random address from the server. Releasing/not wanting an IP is now done by just not listing that IP, i.e. if we only wanted an (random) ipv4 address the request would look as follows: request_ip=1 ip=0.0.0.0/32
* Fix parsing issue with split messagesThomas Gschwantner2019-12-111-16/+17
| | | | | | | Previously this would trigger a BUG_ON() since the calculation of length & offset was wrong since we added the previous part of the buffer (req->buf) in parse_request(). This meant handle_request() couldn't know how much bytes where actually left in the buffer or their offset.
* Fixup client, including a lot of refactoringThomas Gschwantner2019-12-111-8/+0
|
* Extract all RTNETLINK code into ipm.{c,h}Thomas Gschwantner2019-12-111-67/+0
|
* Serialize/deserialize messages into a structThomas Gschwantner2019-12-111-193/+196
| | | | | | Instead of a list of attributes, parse messages into a proper struct to avoid duplicating code in the server/client for handling this list, as well as making parsing nicer in general.
* Improve error handling and serializationThomas Gschwantner2019-08-201-33/+39
|
* Implement lease expirationThomas Gschwantner2019-07-181-1/+0
|
* Use epoll() instead of poll()Thomas Gschwantner2019-06-141-28/+23
| | | | | This enables us to later use the timeout parameter of epoll_wait() to timely remove expired leases.
* Implement basic lease managementThomas Gschwantner2019-06-121-2/+10
|
* Add BUG() and BUG_ON()Thomas Gschwantner2019-06-021-1/+1
|
* Implement faked allocations, server sideLinus Nordberg2019-05-261-14/+170
| | | | | | | | | | Reject clients not connecting from an IPv6 address. Reject clients not connecting from the correct port. Fake address allocation. Update allowed-ips with leases handed out. Send response messages. Extend protocol to include lease start and lease time, errno and errmsg. Move common code to common.[ch].
* Implement key=value parsingThomas Gschwantner2019-02-091-0/+286