npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cloudflash-udhcpd

v0.6.2

Published

cloudflash-udhcpd module implements udhcpd server configuration on unix systems

Downloads

3

Readme

List of uDHCPd APIs

Create DHCP server configuration

Verb    URI        		    Description
POST	/network/udhcpd 	Creating a DHCP server configuraion in VCG.

On success it returns JSON data with the service-id, config success.

TODO: Define JSON format for error codes and description.

Example Request and Response

Request Headers

Request JSON

{
       "start": "192.168.0.20",
       "end": "192.168.0.100",
       "interface": "wan0",
       "max_leases": 254,
       "remaining": "yes",
       "auto_time": 7200,
       "decline_time": 3600,
       "conflict_time": 3600,
       "offer_time": 60,
       "min_lease": 60,
       "lease_file": "/var/lib/misc/udhcpd.leases",
       "pidfile": "/var/run/udhcpd.pid",
       "notify_file": "dumpleases",
       "siaddr": "192.168.0.22",
       "sname": "zorak",
       "boot_file": "/var/lib/misc/udhcpd.leases",
       "option": 
       {
        "subnet":["192.168.0.25"],
        "router":["192.10.0.40", "192.10.0.41"],
        "dns":["192.10.0.40", "192.10.0.41"],
        "wins":["192.10.0.40", "192.10.0.41"],
        "domain":["192.10.0.40", "192.10.0.41"],
        "lease":60,
        "timezone":"IST",
        "timesvr":["192.10.0.40", "192.10.0.41"],
        "logsvr" :["192.10.0.40", "192.10.0.41"],
        "cookiesvr" :["192.10.0.40", "192.10.0.41"],
        "lprsrv" :["192.10.0.40", "192.10.0.41"],
        "hostname":"kvm570"
      }
       
}

Response JSON

{
  "id": "cc6279dd-7409-4cd2-b4ad-086dbd1b59a5",
  "config":
  {
   "start": "192.168.0.20",
   "end": "192.168.0.100",
   "interface": "wan0",
   "max_leases": 254,
   "remaining": "yes",
   "auto_time": 7200,
   "decline_time": 3600,
   "conflict_time": 3600,
   "offer_time": 60,
   "min_lease": 60,
   "lease_file": "/var/lib/misc/udhcpd.leases",
   "pidfile": "/var/run/udhcpd.pid",
   "notify_file": "dumpleases",
   "siaddr": "192.168.0.22",
   "sname": "zorak",
   "boot_file": "/var/lib/misc/udhcpd.leases",
   "option":
   {
       "subnet":
       [
           "192.168.0.25"
       ],
       "router":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "dns":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "wins":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "domain":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "lease": 60,
       "timezone": "IST",
       "timesvr":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "logsvr":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "cookiesvr":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "lprsrv":
       [
           "192.10.0.40",
           "192.10.0.41"
       ],
       "hostname": "kvm570"
   }     
  }      
}

Upon error, error code 500 will be returned

List DHCP servers configuration

Verb	URI	             Description
GET	/network/udhcpd	 List the DHCP servers configuration.

Example Request and Response

Request Headers

GET  /network/udhcpd

Response JSON

[
    {
       "id": "fdc1a6fa-a34a-42fb-b735-837a849bfe64",
       "config": {
            "start": "192.168.0.20",
            "end": "192.168.0.254",
            "interface": "eth0",
            "max_leases": 254,
            "remaining": "yes",
            "auto_time": 7200,
            "decline_time": 3600,
            "conflict_time": 3600,
            "offer_time": 60,
            "min_lease": 60,
            "lease_file": "/var/lib/misc/udhcpd.leases",
            "pidfile": "/var/run/udhcpd.pid",
            "notify_file": "dumpleases",
            "siaddr": "192.168.0.22",
            "option": {
                "subnet": [
                   "1.1.1.1",
                   "2.2.2.2"
                 ],
                 "mtu": "100"
             }
         }
    },
    {
       "id": "4d2b0825-1ce0-4d01-9cc3-3edc5307cfaf",
       "config": {
           "start": "192.168.0.20",
           "end": "192.168.0.254",
           "interface": "eth1",
           "max_leases": 254,
           "remaining": "yes",
           "auto_time": 7200,
           "decline_time": 3600,
           "conflict_time": 3600,
           "offer_time": 60,
           "min_lease": 60,
           "lease_file": "/var/lib/misc/udhcpd.leases",
           "pidfile": "/var/run/udhcpd.pid",
           "notify_file": "dumpleases",
           "siaddr": "192.168.0.22",
           "option": {
              "subnet": [
                    "1.1.1.1",
                    "2.2.2.2"
               ],
           "mtu": "100"
            }
         } 
    }
]

List DHCP server configuration by ID

Verb URI                    Description
GET  /network/udhcpd/:id    List DHCP server configuration.

On Success returns 200 with JSON data

Example Request and Response

Request Headers

GET  /network/udhcpd/cc6279dd-7409-4cd2-b4ad-086dbd1b59a5

Response JSON

  {
    "id": "cc6279dd-7409-4cd2-b4ad-086dbd1b59a5",
    "config":
    {
       "start": "192.168.0.20",
       "end": "192.168.0.100",
       "interface": "wan0",
       "max_leases": 254,
       "remaining": "yes",
       "auto_time": 7200,
       "decline_time": 3600,
       "conflict_time": 3600,
       "offer_time": 60,
       "min_lease": 60,
       "lease_file": "/var/lib/misc/udhcpd.leases",
       "pidfile": "/var/run/udhcpd.pid",
       "notify_file": "dumpleases",
       "siaddr": "192.168.0.22",
       "sname": "zorak",
       "boot_file": "/var/lib/misc/udhcpd.leases",
       "option":
       {
           "subnet":
           [
               "192.168.0.25"
           ],
           "router":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "dns":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "wins":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "domain":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "lease": 60,
           "timezone": "IST",
           "timesvr":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "logsvr":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "cookiesvr":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "lprsrv":
           [
               "192.10.0.40",
               "192.10.0.41"
           ],
           "hostname": "kvm570"
       }
    }
 }

Delete DHCP server configuration

Verb        URI	                    Description
DELETE      /network/udhcpd/:id     Delete DHCP server configuration 

On Success returns status code 204

Example Request and Response

Request Headers

DELETE  /network/udhcpd/cc6279dd-7409-4cd2-b4ad-086dbd1b59a5

Response JSON

Status Code: 204