Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for Embedding in another App? #48

Open
TheColonel2688 opened this issue Feb 10, 2024 · 3 comments
Open

API for Embedding in another App? #48

TheColonel2688 opened this issue Feb 10, 2024 · 3 comments

Comments

@TheColonel2688
Copy link

TheColonel2688 commented Feb 10, 2024

Sorry it doesn't look like Discussions are enabled on this repo.

I am looking to learn rust, and I thought a good little project would be a Temporary/short-lived DHCP Server GUI Utility. Use case is inital provisioning of IoT and Industrial Automation Devices, many of which come with DHCP enable out of box.

Looking at this repo, I don't see any documentation for using dora in another application, it seems to only be a standalone CLI app using yaml for configuration.

It is possible to use it in another app directly? If so where is the documentation for that API?

@stappersg
Copy link

stappersg commented Feb 10, 2024 via email

@TheColonel2688
Copy link
Author

TheColonel2688 commented Feb 11, 2024

It seems like you are being a smart ass and directing me to dhcproto, but I already looked at that repo and it is just a encoder/decorder as for as I can tell, not a server with an API.

I am looking for a server library with an API. That will give me a list of client MACs, and associated IP Address, then let me over override the leased IPaddress for a specific MAC.

I suppose I could impliment that myself on top of dhcproto, but I was hoping such features already existed.

@leshow
Copy link
Collaborator

leshow commented Feb 11, 2024

Please, no need to resort to name calling. On the topic of your question, no such public API exists. You may be able to get by with just reading the sqlite database that dora uses. Another option would be to implement a "plugin" for dora, dora's functionality is split between a core server library that handles reading and writing to a socket and a kind of middleware stack that implements the rest. The core libraries are not in public crates, however, so you'd be forking the repo to add what you need.

If you end up working on this, I'd consider merging it. Perhaps a new optional plugin that writes state changes to a unix socket or something. If you're interested we can discuss further.

I will see if I can open the discussions section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants