⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 DHCP client source code
💻
字号:
In order to test the DHCPv6 server, we have a configuration file withknown values, and some Perl scripts designed to send and receiveDHCPv6 packets to check various code paths.It is not complete test converage by any means, but it should befairly easy to add additional tests as needed.The scripts themselves are not very well written. There is a lot ofcopied code, poor error handling, and so on. These should be rewrittenat some point.To use, the DHCPv6 server must be running in test mode to send back tothe originating port. (The scripts can be changed to bind to theappropriate client port, but they don't now, and have to run as rootto do this). In server/dhcpv6.c, look for this comment:/* For testing, we reply to the sending port, so we don't need a root *//* client */		to_addr.sin6_port = remote_port;/*		to_addr.sin6_port = packet->client_port;*/And change the code to use the client_port value.You will need to modify one of the test configuration files to use one of the physical subnets that your machine uses, in the subnet6 statement.Then run the server as root, in debug mode:# touch /tmp/test.leases# dhcpd -cf test-a.conf -lf /tmp/test.leases -dYou can invoke the scripts then:$ perl 000-badmsgtype.plThe expected results vary per script, depending on the behavior thatis being tested.Notes about scripts:In order to manipulate IPv6 addresses, we need the Socket6 library,available from CPAN:http://search.cpan.org/~umemoto/Socket6-0.19/Socket6.pmThe Perl that Sun issues for Solaris 10 is compiled with the Suncompiler. If you have the Sun compiler, then this will work fine.Otherwise you may need to install Perl from source.We need to get the hardware address in order to build DUID properly.The IO::Interface module reports hardware address, but not on Solaris10 it seems. Rather than do this the "right way", we do it the "Perlway", and hack it. "ifconfig" does return the Ethernet address, butonly to the root user. However, we can look for files of the name/etc/hostname.*, get the IP address from "ifconfig", and then checkfor those addresses in the ARP table.Client DUID is supposed to be an opaque value to the server, but we goahead and make a "real" type 1 or type 3 DUID.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -