Giter VIP home page Giter VIP logo

pydhcplib's Introduction

                 _ _                _ _ _
 _ __  _   _  __| | |__   ___ _ __ | (_) |__
| '_ \| | | |/ _` | '_ \ / __| '_ \| | | '_ \
| |_) | |_| | (_| | | | | (__| |_) | | | |_) |
| .__/ \__, |\__,_|_| |_|\___| .__/|_|_|_.__/
|_|    |___/                 |_|

Pydhcplib

Pydhcplib is a python library to read/write and encode/decode dhcp packet on network.

N.B. This is a fork of this project http://pydhcplib.tuxfamily.org/pmwiki/. The only change [so far] is the implementation of a missing feature as described in the end of this document [1_].

Installation :

On Debian, simply run ./setup.py install. Python modules will be installed in /usr/lib/python2.X/site-packages/pydhcplib/.

If you want to install it on a different location, use the --prefix on the setup.py command line like this:

$ ./setup.py install --prefix=/rootpath/to/your/location/

How to use pydhcplib :

Look in the examples directory to learn how to use the modules.:

$ man pydhcp
$ man pydhcplib

Differences to the original pydhcplib

The short story is I've "stolen" the udp raw socket code from [the amazing] busybox project changing it to work with the udp payload [the actual dhcp packet] this library creates.

This was required to make it work in the case the fields giaddr and ciaddr are zero and the broadcast bit flag is not set. This requires unicasting the udp packet to the yiaddr address, which does not yet exist. Using the kernel to send the packet fails as there is no ARP information available. This requires using raw sockets to inject the missing hwaddr information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.