Skip to content

Commit

Permalink
Guess I need to commit the move.
Browse files Browse the repository at this point in the history
  • Loading branch information
red.hamsterx@gmail.com committed Mar 29, 2013
1 parent 9c3b0fd commit 61e6580
Show file tree
Hide file tree
Showing 38 changed files with 5,510 additions and 2,273 deletions.
2 changes: 1 addition & 1 deletion ACKNOWLEDGEMENTS
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ pydhcplib : http://pydhcplib.tuxfamily.org/pmwiki/

staticDHCPd features a completely overhauled, fully updated, and
stripped-down version of this library, rebranded as 'libpydhcpserver'.


187 changes: 0 additions & 187 deletions README

This file was deleted.

1 change: 1 addition & 0 deletions README
5 changes: 3 additions & 2 deletions libpydhcpserver/libpydhcpserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
(C) Neil Tallim, 2011 <red.hamsterx@gmail.com>
(C) Neil Tallim, 2013 <flan@uguu.ca>
(C) Mathieu Ignacio, 2008 <mignacio@april.org>
"""
VERSION = '1.1.5'
VERSION = '1.1.7'
URL = 'http://uguu.ca/'
4 changes: 2 additions & 2 deletions libpydhcpserver/libpydhcpserver/dhcp_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
0: 'ERROR_UNDEF',
1: 'DHCP_DISCOVER', 2: 'DHCP_OFFER',
3: 'DHCP_REQUEST', 4:'DHCP_DECLINE',
5: 'DHCP_ACK', 6: 'DHCP_NACK',
5: 'DHCP_ACK', 6: 'DHCP_NAK',
7: 'DHCP_RELEASE',
8: 'DHCP_INFORM',
9: 'DHCP_FORCERENEW',
Expand All @@ -46,7 +46,7 @@
'BOOTREQUEST': 1, 'BOOTREPLY': 2,
'DHCP_DISCOVER': 1, 'DHCP_OFFER': 2,
'DHCP_REQUEST': 3, 'DHCP_DECLINE': 4,
'DHCP_ACK': 5, 'DHCP_NACK': 6,
'DHCP_ACK': 5, 'DHCP_NAK': 6,
'DHCP_RELEASE': 7,
'DHCP_INFORM': 8,
'DHCP_FORCERENEW': 9,
Expand Down
17 changes: 7 additions & 10 deletions libpydhcpserver/libpydhcpserver/dhcp_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ def _getNextDHCPPacket(self, timeout=60):
@type timeout: int
@param timeout: The number of seconds to wait before returning.
@rtype: bool
@return: True if something was received; False otherwise.
@rtype: tuple(2)
@return: (received:bool, (address:basestring, port:int)|None), with received
indicating whether a DHCP packet was received or not and the tuple
reflecting the source of the received packet, if any.
"""
active_sockets = None
source_address = None
if self._pxe_socket:
active_sockets = select.select([self._dhcp_socket, self._pxe_socket], [], [], timeout)[0]
else:
Expand All @@ -149,8 +152,8 @@ def _getNextDHCPPacket(self, timeout=60):
threading.Thread(target=self._handleDHCPDecline, args=(packet, source_address, pxe)).start()
elif packet.isDHCPLeaseQueryPacket():
threading.Thread(target=self._handleDHCPLeaseQuery, args=(packet, source_address, pxe)).start()
return True
return False
return (True, source_address)
return (False, source_address)

def _handleDHCPDecline(self, packet, source_address, pxe):
"""
Expand All @@ -164,7 +167,6 @@ def _handleDHCPDecline(self, packet, source_address, pxe):
@type pxe: bool
@param pxe: True if the packet was received on the PXE port.
"""
pass

def _handleDHCPDiscover(self, packet, source_address, pxe):
"""
Expand All @@ -178,7 +180,6 @@ def _handleDHCPDiscover(self, packet, source_address, pxe):
@type pxe: bool
@param pxe: True if the packet was received on the PXE port.
"""
pass

def _handleDHCPInform(self, packet, source_address, pxe):
"""
Expand All @@ -192,7 +193,6 @@ def _handleDHCPInform(self, packet, source_address, pxe):
@type pxe: bool
@param pxe: True if the packet was received on the PXE port.
"""
pass

def _handleDHCPLeaseQuery(self, packet, source_address, pxe):
"""
Expand All @@ -206,7 +206,6 @@ def _handleDHCPLeaseQuery(self, packet, source_address, pxe):
@type pxe: bool
@param pxe: True if the packet was received on the PXE port.
"""
pass

def _handleDHCPRelease(self, packet, source_address):
"""
Expand All @@ -218,7 +217,6 @@ def _handleDHCPRelease(self, packet, source_address):
@param source_address: The address (host, port) from which the request
was received.
"""
pass

def _handleDHCPRequest(self, packet, source_address, pxe):
"""
Expand All @@ -232,7 +230,6 @@ def _handleDHCPRequest(self, packet, source_address, pxe):
@type pxe: bool
@param pxe: True if the packet was received on the PXE port.
"""
pass

def _sendDHCPPacketTo(self, packet, ip, port, pxe):
"""
Expand Down
Loading

0 comments on commit 61e6580

Please sign in to comment.