source: package_tags/sipb-xen-python-pydhcplib/0.3.2-1/examples/gen_packet_example.py @ 2665

Last change on this file since 2665 was 361, checked in by broder, 16 years ago

Splitting pydhcplib off into its own package

Hold onto your hats, folks - this could get messy

  • Property svn:executable set to *
File size: 437 bytes
Line 
1#!/usr/bin/python
2
3from pydhcplib.dhcp_packet import DhcpPacket
4from pydhcplib.type_strlist import strlist
5from pydhcplib.type_ipv4 import ipv4
6
7
8packet = DhcpPacket()
9
10packet.SetOption("domain_name",strlist("anemon.org").list())
11packet.SetOption("router",ipv4("192.168.0.1").list()+[6,4,2,1])
12packet.SetOption("time_server",[100,100,100,7,6,4,2,1])
13packet.SetOption("yiaddr",[192,168,0,18])
14
15packet.PrintHeaders()
16packet.PrintOptions()
Note: See TracBrowser for help on using the repository browser.