Skip to content

Commit

Permalink
Fix markdown issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusb authored Jan 17, 2020
1 parent 7799ce4 commit 2396207
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ omapi-key defomapi;
omapi-port 7911;
```

**Replace the given secret by a key created on your own!**
Replace the given secret by a key created on your own!

To generate a key use the following command:

Expand Down Expand Up @@ -80,7 +80,6 @@ ip = omapi.lookup_ip(mac)
print("%s mac currently has ip %s assigned" % (mac, ip))
```


If you need full lease information, you can also query the full lease directly by using **lookup_by_lease**, which gives you the full lease details as output:

```
Expand Down Expand Up @@ -140,29 +139,29 @@ b'ip-address': b'\xc0\xa8\n\xa7'

The following lookup functions are implemented, allowing directly querying the different types:

* lookup_ip_host(mac) - lookups up a host object (static defined host) by mac
* lookup_ip(mac) - lookups a lease object by mac and returns the ip
* lookup_host(name) - lookups a host object by name and returns the ip, mac and hostname
* lookup_host_host(mac) - lookups a host object by mac and returns the ip, mac and name
* lookup_hostname(ip) - lookups a lease object by ip and returns the client-hostname
* lookup_ip_host(mac) - lookups up a host object (static defined host) by mac
* lookup_ip(mac) - lookups a lease object by mac and returns the ip
* lookup_host(name) - lookups a host object by name and returns the ip, mac and hostname
* lookup_host_host(mac) - lookups a host object by mac and returns the ip, mac and name
* lookup_hostname(ip) - lookups a lease object by ip and returns the client-hostname

These special functions use:

* lookup_by_host - generic lookup function for host objects
* lookup_by_lease - generic lookup function for lease objects
* lookup_by_host - generic lookup function for host objects
* lookup_by_lease - generic lookup function for lease objects

which provide full access to complete lease data.

## Add and delete host objects

For adding and deleting host objects (static DHCP leases), there are multiple functions:

* add_host(ip, mac)
* add_host_supersede_name(ip, mac, name)
* add_host_without_ip(mac)
* add_host_supersede(ip, mac, name, hostname=None, router=None, domain=None)
* add_group(groupname, statements)
* add_host_with_group(ip, mac, groupname))
* add_host(ip, mac)
* add_host_supersede_name(ip, mac, name)
* add_host_without_ip(mac)
* add_host_supersede(ip, mac, name, hostname=None, router=None, domain=None)
* add_group(groupname, statements)
* add_host_with_group(ip, mac, groupname))

See http://jpmens.net/2011/07/20/dynamically-add-static-leases-to-dhcpd/ for original idea (which is now merged) and detailed explanation.

Expand Down

0 comments on commit 2396207

Please sign in to comment.