SHA256
1
0
forked from pool/dhcp
OBS User unknown
2007-01-10 16:39:58 +00:00
committed by Git OBS Bridge
commit cfcbc0cde3
43 changed files with 6233 additions and 0 deletions

25
dnscompr.py Normal file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/python
# Copyright 2005 Peter Poeml <poeml@suse.de>. All Rights Reserved.
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
def compr(names):
import dns, dns.name, cStringIO
f = cStringIO.StringIO()
compress = {}
for i in names:
n = dns.name.from_text(i)
n.to_wire(f, compress)
return f.getvalue()
if __name__ == '__main__':
import sys
nlist = sys.argv[1:]
print repr(compr(nlist))