FreeBSD Bugzilla – Attachment 152324 Details for
Bug 197162
[NEW PORT] net-mgmt/dhcp_probe: Detect DHCP servers on network
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
dhcp_probe.shar
dhcp_probe.shar (text/plain), 22.24 KB, created by
Kevin Hung
on 2015-01-29 02:26:04 UTC
(
hide
)
Description:
dhcp_probe.shar
Filename:
MIME Type:
Creator:
Kevin Hung
Created:
2015-01-29 02:26:04 UTC
Size:
22.24 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># dhcp_probe ># dhcp_probe/Makefile ># dhcp_probe/files ># dhcp_probe/files/patch-src_bootp.c ># dhcp_probe/files/patch-src_get__myeaddr.c ># dhcp_probe/files/patch-src_dhcp__probe.h ># dhcp_probe/files/patch-src_dhcp__probe.c ># dhcp_probe/files/patch-src_defs.h ># dhcp_probe/files/patch-src_daemonize.c ># dhcp_probe/files/patch-src_configfile.h ># dhcp_probe/files/patch-src_configfile.c ># dhcp_probe/files/patch-src_get__myeaddr.h ># dhcp_probe/files/dhcp_probe.in ># dhcp_probe/files/patch-Makefile.am ># dhcp_probe/files/pkg-message.in ># dhcp_probe/pkg-descr ># dhcp_probe/distinfo ># dhcp_probe/pkg-plist ># >echo c - dhcp_probe >mkdir -p dhcp_probe > /dev/null 2>&1 >echo x - dhcp_probe/Makefile >sed 's/^X//' >dhcp_probe/Makefile << '19f02c85b833427048123ec8b64e366c' >X# Created by: Kevin Hung <khung@nullaxiom.com> >X# $FreeBSD$ >X >XPORTNAME= dhcp_probe >XPORTVERSION= 1.3.0 >XCATEGORIES= net-mgmt >XMASTER_SITES= https://www.net.princeton.edu/software/dhcp_probe/ >X >XMAINTAINER= khung@nullaxiom.com >XCOMMENT= Attempts to discover DHCP and BootP servers on a network >X >XLICENSE= GPLv2 addl >XLICENSE_COMB= multi >XLICENSE_NAME_addl=Additional legal notices for copyrighted code >XLICENSE_PERMS_addl=dist-mirror dist-sell pkg-mirror pkg-sell >XLICENSE_FILE_addl=${WRKSRC}/COPYING >X >XLIB_DEPENDS= libnet.so:${PORTSDIR}/net/libnet \ >X libpcap.so:${PORTSDIR}/net/libpcap >X >XUSE_AUTOTOOLS= aclocal automake >XAUTOMAKE_ARGS= -a >XGNU_CONFIGURE= yes >XCONFIGURE_ARGS= --with-libnet-include=${LOCALBASE}/include/libnet11/ --with-libnet-lib=${LOCALBASE}/lib/libnet11/ >XMANPREFIX= ${PREFIX} >X >XUSE_RC_SUBR= dhcp_probe >X >XSUB_FILES= pkg-message >X >X# Can't use INSTALL_PROGRAM macro as we need to patch Makefile.am and >X# regenerate Makefile.in >Xpost-install: >X ${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/dhcp_probe >X >X.include <bsd.port.mk> >19f02c85b833427048123ec8b64e366c >echo c - dhcp_probe/files >mkdir -p dhcp_probe/files > /dev/null 2>&1 >echo x - dhcp_probe/files/patch-src_bootp.c >sed 's/^X//' >dhcp_probe/files/patch-src_bootp.c << 'cb1bb6e0af6e76d5ce7649ce02d6ee3c' >X--- src/bootp.c.orig 2015-01-03 11:14:43.000000000 -0500 >X+++ src/bootp.c 2015-01-16 00:27:42.000000000 -0500 >X@@ -11,6 +11,7 @@ >X #include "bootp.h" >X #include "configfile.h" >X #include "report.h" >X+#include "utils.h" >X >X >X >X@@ -20,7 +21,7 @@ >X unsigned char vendor_option_end[] = VENDOR_OPTION_END; >X unsigned char vendor_option_dhcpmessagetype_dhcpdiscover[] = VENDOR_OPTION_DHCPDISCOVER; >X unsigned char vendor_option_dhcpmessagetype_dhcprequest[] = VENDOR_OPTION_DHCPREQUEST; >X-unsigned char vendor_option_clientid[1 + 1 + 1 + sizeof(struct ether_addr)]; /* option code, length byte, htype byte, ether_addr */ >X+unsigned char vendor_option_clientid[1 + 1 + 1 + sizeof(struct libnet_ether_addr)]; /* option code, length byte, htype byte, ether_addr */ >X unsigned char vendor_option_serverid[1 + 1 + 4]; /* option code, length byte, ip_addr */ >X unsigned char vendor_option_requestedipaddr[1 + 1 + 4]; /* option code, length byte, ip_addr */ >X >X@@ -73,7 +74,7 @@ >X char label[NUM_FLAVORS_MAXSTRING]; >X snprintf(label, sizeof(label)-1, "%d", i); >X if (libnet_cq_add(l, label) == -1) { >X- report(LOG_ERR, "init_libnet_context_queue: libnet_cq_add: error adding libnet context '%s' to queue: %s", label, libnet_errbuf); >X+ report(LOG_ERR, "init_libnet_context_queue: libnet_cq_add: error adding libnet context '%s' to queue: %s", label, libnet_geterror(l)); >X return(0); >X } >X } >X@@ -124,7 +125,7 @@ >X packet->bootp_hlen = HLEN_ETHER; >X packet->bootp_xid = BOOTP_XID; >X packet->bootp_op = BOOTREQUEST; >X- bcopy(GetChaddr(), &packet->bootp_chaddr, sizeof(struct ether_addr)); >X+ bcopy(GetChaddr(), &packet->bootp_chaddr, sizeof(struct libnet_ether_addr)); >X >X /* add RFC1048 cookie to options field */ >X insert_option(&next_vendor_option, vendor_option_vm_cookie_rfc1048, sizeof(vendor_option_vm_cookie_rfc1048)); >X@@ -311,11 +312,11 @@ >X vendor_option_clientid[0] = VENDOR_OPTION_CLIENTID; >X >X /* length byte */ >X- vendor_option_clientid[1] = 1 + sizeof(struct ether_addr); >X+ vendor_option_clientid[1] = 1 + sizeof(struct libnet_ether_addr); >X >X /* fill in clientid value: htype code followed by enet addr */ >X vendor_option_clientid[2] = 0x01; >X- bcopy(GetChaddr(), vendor_option_clientid+3, sizeof(struct ether_addr)); >X+ bcopy(GetChaddr(), vendor_option_clientid+3, sizeof(struct libnet_ether_addr)); >X >X return; >X } >cb1bb6e0af6e76d5ce7649ce02d6ee3c >echo x - dhcp_probe/files/patch-src_get__myeaddr.c >sed 's/^X//' >dhcp_probe/files/patch-src_get__myeaddr.c << '241170ae095f1ec2871db28ee5672898' >X--- src/get_myeaddr.c.orig 2015-01-03 11:44:45.000000000 -0500 >X+++ src/get_myeaddr.c 2015-01-03 11:45:40.000000000 -0500 >X@@ -55,7 +55,7 @@ >X >X >X int >X-get_myeaddr(int sockfd, struct in_addr *my_ipaddr, struct ether_addr *my_eaddr, const char *ifname) >X+get_myeaddr(int sockfd, struct in_addr *my_ipaddr, struct libnet_ether_addr *my_eaddr, const char *ifname) >X { >X /* If SIOCGIFHWADDR is defined, >X We use the SIOCGIFHWADDR ioctl to do our work as follows: >X@@ -92,7 +92,7 @@ >X return(-1); >X } >X >X- bcopy(ifr.ifr_hwaddr.sa_data, my_eaddr, sizeof (struct ether_addr)); >X+ bcopy(ifr.ifr_hwaddr.sa_data, my_eaddr, sizeof (struct libnet_ether_addr)); >X >X #elif defined SIOCGARP /* not SIOCGIFHWADDR */ >X >X@@ -154,7 +154,7 @@ >X return(-1); >X } >X >X- bcopy(arpreq.arp_ha.sa_data, my_eaddr, sizeof (struct ether_addr)); >X+ bcopy(arpreq.arp_ha.sa_data, my_eaddr, sizeof (struct libnet_ether_addr)); >X >X #elif defined HAVE_GETIFADDRS /* not SIOCGARP */ >X >X@@ -180,7 +180,7 @@ >X found = 1; >X /* copy the result to my_eaddr */ >X sdl = (struct sockaddr_dl *) ifp->ifa_addr; >X- bcopy((const void *)LLADDR(sdl), my_eaddr, sizeof (struct ether_addr)); >X+ bcopy((const void *)LLADDR(sdl), my_eaddr, sizeof (struct libnet_ether_addr)); >X >X } >X } >241170ae095f1ec2871db28ee5672898 >echo x - dhcp_probe/files/patch-src_dhcp__probe.h >sed 's/^X//' >dhcp_probe/files/patch-src_dhcp__probe.h << '70713b1e6fc19281a3bb5fdf8fe178a2' >X--- src/dhcp_probe.h.orig 2015-01-03 11:43:49.000000000 -0500 >X+++ src/dhcp_probe.h 2015-01-03 11:44:11.000000000 -0500 >X@@ -18,7 +18,7 @@ >X >X extern int sockfd; /* general purpose datagram socket fd for temp use throughout */ >X >X-extern struct ether_addr my_eaddr; >X+extern struct libnet_ether_addr my_eaddr; >X >X >X >70713b1e6fc19281a3bb5fdf8fe178a2 >echo x - dhcp_probe/files/patch-src_dhcp__probe.c >sed 's/^X//' >dhcp_probe/files/patch-src_dhcp__probe.c << '05679156e74fc291920ea02ef06dd60b' >X--- src/dhcp_probe.c.orig 2015-01-03 11:16:23.000000000 -0500 >X+++ src/dhcp_probe.c 2015-01-17 11:44:33.000000000 -0500 >X@@ -69,7 +69,7 @@ >X enum dhcp_flavor_t packet_flavors[] = {BOOTP, DHCP_INIT, DHCP_SELECTING, DHCP_INIT_REBOOT, DHCP_REBINDING}; >X >X char *ifname; >X-struct ether_addr my_eaddr; >X+struct libnet_ether_addr my_eaddr; >X >X int use_8021q = 0; >X int vlan_id = 0; >X@@ -96,7 +96,7 @@ >X bpf_u_int32 netnumber, netmask; >X struct bpf_program bpf_code; >X int linktype; >X- char pcap_errbuf[PCAP_ERRBUF_SIZE], pcap_errbuf2[PCAP_ERRBUF_SIZE]; >X+ char pcap_errbuf[PCAP_ERRBUF_SIZE]; >X >X /* for libnet */ >X char libnet_errbuf[LIBNET_ERRBUF_SIZE]; >X@@ -228,6 +228,7 @@ >X /* ignore SIGHUP */ >X sigemptyset(&sa.sa_mask); >X sa.sa_handler = SIG_IGN; >X+ sa.sa_flags = 0; >X if (sigaction(SIGHUP, &sa, NULL) < 0) { >X report(LOG_ERR, "sigaction: %s", get_errmsg()); >X my_exit(1, 0, 1); >X@@ -236,6 +237,7 @@ >X /* ignore SIGUSR1 */ >X sigemptyset(&sa.sa_mask); >X sa.sa_handler = SIG_IGN; >X+ sa.sa_flags = 0; >X if (sigaction(SIGUSR1, &sa, NULL) < 0) { >X report(LOG_ERR, "sigaction: %s", get_errmsg()); >X my_exit(1, 0, 1); >X@@ -243,12 +245,12 @@ >X /* ignore SIGUSR2 */ >X sigemptyset(&sa.sa_mask); >X sa.sa_handler = SIG_IGN; >X+ sa.sa_flags = 0; >X if (sigaction(SIGUSR2, &sa, NULL) < 0) { >X report(LOG_ERR, "sigaction: %s", get_errmsg()); >X my_exit(1, 0, 1); >X } >X >X- >X /* write pid file as soon as possible after (possibly) forking */ >X if ((pid_fp = open_for_writing(pid_file)) == NULL) { >X report(LOG_ERR, "could not open pid file %s for writing", pid_file); >X@@ -401,7 +403,7 @@ >X */ >X pcap_errbuf[0] = '\0'; /* so we can tell if a warning was produced on success */ >X if ((pd_template = pcap_open_live(ifname, snaplen, 0, 1, pcap_errbuf)) == NULL) { >X- report(LOG_ERR, "pcap_open_live %s: %s", ifname, pcap_errbuf2); >X+ report(LOG_ERR, "pcap_open_live %s: %s", ifname, pcap_errbuf); >X my_exit(1, 1, 1); >X } >X if (pcap_errbuf[0] != '\0') >X@@ -470,8 +472,8 @@ >X it's possible there's a server out there that does it wrong, and might therefore mistakenly >X send responses to ether_src. So lets also listen promiscuously if ether_src != my_eaddr. >X */ >X- if (bcmp(GetChaddr(), &my_eaddr, sizeof(struct ether_addr)) || >X- bcmp(GetEther_src(), &my_eaddr, sizeof(struct ether_addr))) >X+ if (bcmp(GetChaddr(), &my_eaddr, sizeof(struct libnet_ether_addr)) || >X+ bcmp(GetEther_src(), &my_eaddr, sizeof(struct libnet_ether_addr))) >X promiscuous = 1; >X else >X promiscuous = 0; >X@@ -699,8 +701,8 @@ >X When we return, control returns to pcap_dispatch() so it can continue capturing packets. >X */ >X >X- struct ether_header *ether_header; /* access ethernet header */ >X- struct ip *ip_header; /* access ip header */ >X+ struct libnet_ethernet_hdr *ether_header; /* access ethernet header */ >X+ struct libnet_ipv4_hdr *ip_header; /* access ip header */ >X bpf_u_int32 ether_len; /* bpf_u_int32 from pcap.h */ >X struct udphdr *udp_header; /* access UDP header */ >X struct bootp *bootp_pkt; /* access bootp/dhcp packet */ >X@@ -710,7 +712,7 @@ >X int isLegalServer; /* boolean */ >X >X /* fields parsed out from packet*/ >X- struct ether_addr ether_dhost, ether_shost; >X+ struct libnet_ether_addr ether_dhost, ether_shost; >X struct in_addr ip_src, ip_dst, yiaddr; >X /* string versions of same */ >X char ether_dhost_str[MAX_ETHER_ADDR_STR], ether_shost_str[MAX_ETHER_ADDR_STR]; >X@@ -729,13 +731,13 @@ >X return; >X } >X >X- if ((ether_len < sizeof(sizeof(struct ether_header))) && (debug > 1)) { >X+ if ((ether_len < sizeof(sizeof(struct libnet_ethernet_hdr))) && (debug > 1)) { >X report(LOG_WARNING, "interface %s, short packet (got %d bytes, smaller than an Ethernet header)", ifname, ether_len); >X return; >X } >X >X /* we use ether_header to access the Ethernet header */ >X- ether_header = (struct ether_header *) packet; >X+ ether_header = (struct libnet_ethernet_hdr *) packet; >X >X /* parse fields out of ethernet header for easier access */ >X bcopy(&(ether_header->ether_dhost), ðer_dhost, sizeof(ether_dhost)); >X@@ -747,13 +749,13 @@ >X if (debug > 10) >X report(LOG_DEBUG, " interface %s, from ether %s to %s", ifname, ether_shost_str, ether_dhost_str); >X >X- if (ether_len < sizeof(sizeof(struct ether_header)) + sizeof(struct ip)) { >X+ if (ether_len < sizeof(sizeof(struct libnet_ethernet_hdr)) + sizeof(struct libnet_ipv4_hdr)) { >X report(LOG_WARNING, "interface %s, ether src %s: short packet (got %d bytes, smaller than IP header in Ethernet)", ifname, ether_shost_str, ether_len); >X return; >X } >X >X /* we use ip_header to access the IP header */ >X- ip_header = (struct ip *) (packet + sizeof(struct ether_header)); >X+ ip_header = (struct libnet_ipv4_hdr *) (packet + sizeof(struct libnet_ethernet_hdr)); >X >X /* parse fields out of ip header for easier access */ >X bcopy(&(ip_header->ip_src), &ip_src, sizeof(ip_header->ip_src)); >X@@ -768,15 +770,15 @@ >X ip_header_len_bytes = ip_header->ip_hl << 2; >X >X /* Repeat the packet size check (through IP header), but taking into account ip_header_len_bytes */ >X- if (ether_len < sizeof(sizeof(struct ether_header)) + ip_header_len_bytes) { >X+ if (ether_len < sizeof(sizeof(struct libnet_ethernet_hdr)) + ip_header_len_bytes) { >X report(LOG_WARNING, "interface %s, short packet (got %d bytes, smaller than IP header in Ethernet)", ifname, ether_len); >X return; >X } >X >X /* we use udp_header to access the UDP header */ >X- udp_header = (struct udphdr *) (packet + sizeof(struct ether_header) + ip_header_len_bytes); >X+ udp_header = (struct udphdr *) (packet + sizeof(struct libnet_ethernet_hdr) + ip_header_len_bytes); >X >X- if (ether_len < sizeof(sizeof(struct ether_header)) + ip_header_len_bytes + sizeof(struct udphdr)) { >X+ if (ether_len < sizeof(sizeof(struct libnet_ethernet_hdr)) + ip_header_len_bytes + sizeof(struct udphdr)) { >X report(LOG_WARNING, "interface %s ether src %s: short packet (got %d bytes, smaller than UDP/IP header in Ethernet)", ifname, ether_shost_str, ether_len); >X return; >X } >X@@ -800,7 +802,7 @@ >X } >X >X /* we use bootp_pkt to access the bootp/dhcp packet */ >X- bootp_pkt = (struct bootp *) (packet + sizeof(struct ether_header) + ip_header_len_bytes + sizeof(struct udphdr)); >X+ bootp_pkt = (struct bootp *) (packet + sizeof(struct libnet_ethernet_hdr) + ip_header_len_bytes + sizeof(struct udphdr)); >X >X /* Make sure the packet is in response to our query, otherwise ignore it. >X Our query had bootp_htype=HTYPE_ETHER, bootp_hlen=HLEN_ETHER, and bootp_chaddr=GetChaddr(). >X@@ -820,7 +822,7 @@ >X >X if (bcmp(bootp_pkt->bootp_chaddr, GetChaddr(), HLEN_ETHER)) { >X if (debug > 10) { >X- struct ether_addr ether_tmp; >X+ struct libnet_ether_addr ether_tmp; >X char ether_tmp_str[MAX_ETHER_ADDR_STR]; >X >X /* create printable version of bootp_pkt->bootp_chaddr */ >05679156e74fc291920ea02ef06dd60b >echo x - dhcp_probe/files/patch-src_defs.h >sed 's/^X//' >dhcp_probe/files/patch-src_defs.h << '17bb8d65d531250621ff7939dc8cc9be' >X--- src/defs.h.orig 2015-01-03 11:21:50.000000000 -0500 >X+++ src/defs.h 2015-01-03 11:50:57.000000000 -0500 >X@@ -154,17 +154,21 @@ >X >X /* Prototypes for these routines are missing from some systems. */ >X #if !HAVE_DECL_ETHER_NTOA >X-extern char *ether_ntoa (const struct ether_addr *e); >X+extern char *ether_ntoa (const struct libnet_ether_addr *e); >X #endif >X #if !HAVE_DECL_ETHER_ATON >X-extern struct ether_addr *ether_aton(const char *hostname); >X+extern struct libnet_ether_addr *ether_aton(const char *hostname); >X #endif >X #if !HAVE_DECL_ETHER_NTOHOST >X-extern int ether_ntohost (char *hostname, const struct ether_addr *e); >X+extern int ether_ntohost (char *hostname, const struct libnet_ether_addr *e); >X #endif >X #if !HAVE_DECL_ETHER_HOSTTON >X-extern int ether_hostton (const char *hostname, struct ether_addr *e); >X+extern int ether_hostton (const char *hostname, struct libnet_ether_addr *e); >X #endif >X >X+/* libnet 1.1.3+ has ether_addr_octet in struct libnet_ether_addr{} */ >X+#ifndef STRUCT_ETHER_ADDR_HAS_ETHER_ADDR_OCTET >X+#define STRUCT_ETHER_ADDR_HAS_ETHER_ADDR_OCTET 1 >X+#endif >X >X #endif /* not DEFS_H */ >17bb8d65d531250621ff7939dc8cc9be >echo x - dhcp_probe/files/patch-src_daemonize.c >sed 's/^X//' >dhcp_probe/files/patch-src_daemonize.c << 'b34d623b09202cbf204700b2605f5dc6' >X--- src/daemonize.c.orig 2015-01-10 21:06:25.000000000 -0500 >X+++ src/daemonize.c 2015-01-10 21:08:15.000000000 -0500 >X@@ -39,6 +39,7 @@ >X /* ignore HUP we will receive when session leader (first child) terminates */ >X sigemptyset(&sa.sa_mask); >X sa.sa_handler = SIG_IGN; >X+ sa.sa_flags = 0; >X if (sigaction(SIGHUP, &sa, NULL) < 0) { >X report(LOG_ERR, "sigaction: %s", get_errmsg()); >X report(LOG_NOTICE, "exiting"); >b34d623b09202cbf204700b2605f5dc6 >echo x - dhcp_probe/files/patch-src_configfile.h >sed 's/^X//' >dhcp_probe/files/patch-src_configfile.h << 'd3c1fb2a577c47262a909e92c78dc4fc' >X--- src/configfile.h.orig 2015-01-03 11:29:51.000000000 -0500 >X+++ src/configfile.h 2015-01-03 11:40:09.000000000 -0500 >X@@ -6,14 +6,14 @@ >X int read_configfile(const char *fname); >X >X /* accessor functions for all the configuration file data */ >X-struct ether_addr * GetChaddr (void); >X-struct ether_addr * GetEther_src (void); >X+struct libnet_ether_addr * GetChaddr (void); >X+struct libnet_ether_addr * GetEther_src (void); >X struct in_addr * GetClient_ip_address(void); >X struct in_addr * GetServer_id(void); >X unsigned GetCycle_time(void); >X int GetResponse_wait_time(void); >X int isLegalServersMember(struct in_addr *ipaddr); >X-int isLegalServerEthersrcsMember(struct ether_addr *eaddr); >X+int isLegalServerEthersrcsMember(struct libnet_ether_addr *eaddr); >X int isInLeaseNetworksOfConcern(struct in_addr *ipaddr); >X >X char * GetAlert_program_name(void); >d3c1fb2a577c47262a909e92c78dc4fc >echo x - dhcp_probe/files/patch-src_configfile.c >sed 's/^X//' >dhcp_probe/files/patch-src_configfile.c << '3ed82dba904e519fa7c6454c29b660a5' >X--- src/configfile.c.orig 2015-01-03 11:29:45.000000000 -0500 >X+++ src/configfile.c 2015-01-03 11:54:18.000000000 -0500 >X@@ -20,12 +20,12 @@ >X >X /* chaddr to use for bootp header 'chaddr' and to construct ClientID option */ >X /* optionally specified by user; if unspecified, GetChaddr() returns my_eaddr */ >X-struct ether_addr chaddr; >X+struct libnet_ether_addr chaddr; >X int is_chaddr_specified; /* flag */ >X >X-/* ether_addr to use for ethernet frame src */ >X+/* libnet_ether_addr to use for ethernet frame src */ >X /* optionally specified by user; if unspecified, GetEther_src() returns my_eaddr */ >X-struct ether_addr ether_src; >X+struct libnet_ether_addr ether_src; >X int is_ether_src_specified; /* flag */ >X >X /* An ipaddr to use for "Server Identifer" option (when this is needed) >X@@ -50,7 +50,7 @@ >X int num_legal_servers; >X >X /* array of legal DHCP servers' ethersrc addresses, and number elems in array */ >X-struct ether_addr legal_server_ethersrcs[MAX_LEGAL_SERVER_ETHERSRCS]; >X+struct libnet_ether_addr legal_server_ethersrcs[MAX_LEGAL_SERVER_ETHERSRCS]; >X int num_legal_server_ethersrcs; >X >X /* parallel arrays of "lease networks of concern" (address & mask), and number of elems in arrays. >X@@ -85,7 +85,7 @@ >X int tokens; /* number of tokens successfully read by sscanf */ >X int tmpint; >X unsigned int tmpuint; >X- struct ether_addr *enet; >X+ struct libnet_ether_addr *enet; >X struct in_addr inaddr, inaddr2; >X >X /* init all values to defaults */ >X@@ -420,14 +420,14 @@ >X } >X >X >X-struct ether_addr * >X+struct libnet_ether_addr * >X GetChaddr (void) >X { >X /* Return copy of chaddr (if specified) else my_eaddr. >X Not re-entrant; we use static storage to hold the value address we return. >X Should not be called until global 'my_eaddr' has been init'd. >X */ >X- static struct ether_addr chaddr_copy; >X+ static struct libnet_ether_addr chaddr_copy; >X >X /* we re-init the static copy on each call, since we don't know if the >X caller has written into it. */ >X@@ -442,14 +442,14 @@ >X } >X >X >X-struct ether_addr * >X+struct libnet_ether_addr * >X GetEther_src (void) >X { >X /* Return copy of ether_src (if specified) else my_eaddr. >X Not re-entrant; we use static storage to hold the value address we return. >X Should not be called until global 'my_eaddr' has been init'd. >X */ >X- static struct ether_addr ether_src_copy; >X+ static struct libnet_ether_addr ether_src_copy; >X >X /* we re-init the static copy on each call, since we don't know if the >X caller has written into it. */ >X@@ -555,7 +555,7 @@ >X } >X >X int >X-isLegalServerEthersrcsMember(struct ether_addr *eaddr) >X+isLegalServerEthersrcsMember(struct libnet_ether_addr *eaddr) >X { >X /* If eaddr is a member of legal_server_ethersrcs[], return true. >X If legal_server_ethersrcs[] is empty, also return true. >X@@ -576,7 +576,7 @@ >X return 1; >X >X for (i = 0; i < num_legal_server_ethersrcs; i++) { >X- if (!bcmp(eaddr, &legal_server_ethersrcs[i], sizeof(struct ether_addr))) >X+ if (!bcmp(eaddr, &legal_server_ethersrcs[i], sizeof(struct libnet_ether_addr))) >X return 1; /* found */ >X } >X return 0; /* not found */ >3ed82dba904e519fa7c6454c29b660a5 >echo x - dhcp_probe/files/patch-src_get__myeaddr.h >sed 's/^X//' >dhcp_probe/files/patch-src_get__myeaddr.h << '36f97f9def4ea0d07712e28aa032d308' >X--- src/get_myeaddr.h.orig 2015-01-03 11:44:55.000000000 -0500 >X+++ src/get_myeaddr.h 2015-01-03 11:45:52.000000000 -0500 >X@@ -1,6 +1,6 @@ >X #ifndef GET_MYEADDR_H >X #define GET_MYEADDR_H >X >X-int get_myeaddr(int sockfd, struct in_addr *my_ipaddr, struct ether_addr *my_eaddr, const char *ifname); >X+int get_myeaddr(int sockfd, struct in_addr *my_ipaddr, struct libnet_ether_addr *my_eaddr, const char *ifname); >X >X #endif /* not GET_MYEADDR_H */ >36f97f9def4ea0d07712e28aa032d308 >echo x - dhcp_probe/files/dhcp_probe.in >sed 's/^X//' >dhcp_probe/files/dhcp_probe.in << '1d909db875fecbd62ad6aa5ab957008f' >X#!/bin/sh >X >X# $FreeBSD$ >X# >X# PROVIDE: dhcp_probe >X# REQUIRE: LOGIN >X# KEYWORD: shutdown >X# >X# Add the following lines to /etc/rc.conf to enable dhcp_probe: >X# >X# dhcp_probe_enable="YES" >X# dhcp_probe_flags="<interface>" >X >X. /etc/rc.subr >X >Xname=dhcp_probe >Xdesc="Attempts to discover DHCP and BootP servers on a network." >Xrcvar=dhcp_probe_enable >X >Xload_rc_config $name >X >X: ${dhcp_probe_enable:="NO"} >X: ${dhcp_probe_config="%%PREFIX%%/etc/dhcp_probe.cf"} >X >Xcommand=%%PREFIX%%/sbin/${name} >X >Xcommand_args="-c $dhcp_probe_config" >X >Xrun_rc_command "$1" >1d909db875fecbd62ad6aa5ab957008f >echo x - dhcp_probe/files/patch-Makefile.am >sed 's/^X//' >dhcp_probe/files/patch-Makefile.am << '11594aa706e4908410447894a7bc1cc2' >X--- Makefile.am.orig 2015-01-28 01:27:58.000000000 -0500 >X+++ Makefile.am 2015-01-28 01:38:40.000000000 -0500 >X@@ -25,3 +25,6 @@ >X extras/README >X >X ACLOCAL_AMFLAGS = -I m4 >X+ >X+## Copy sample configuration file to PREFIX/etc/ >X+sysconf_DATA= extras/dhcp_probe.cf.sample >11594aa706e4908410447894a7bc1cc2 >echo x - dhcp_probe/files/pkg-message.in >sed 's/^X//' >dhcp_probe/files/pkg-message.in << '40a339522e086ab6857d1dd5661bc696' >XNow it is time to configure this package. >XUpdate %%PREFIX%%/etc/dhcp_probe.cf with desired configuration. >40a339522e086ab6857d1dd5661bc696 >echo x - dhcp_probe/pkg-descr >sed 's/^X//' >dhcp_probe/pkg-descr << '9b52ea52e9c1300817fab29358d94a03' >XAttempts to discover DHCP and BootP servers on a network >X >XWWW: https://www.net.princeton.edu/software/dhcp_probe/ >9b52ea52e9c1300817fab29358d94a03 >echo x - dhcp_probe/distinfo >sed 's/^X//' >dhcp_probe/distinfo << '8d1c659fcc41522b34aa86d9aeba0237' >XSHA256 (dhcp_probe-1.3.0.tar.gz) = 227cd6a82a7fa4d989994cb076f18092bc2c82592ceaeb31c4fdd09294b9265f >XSIZE (dhcp_probe-1.3.0.tar.gz) = 211613 >8d1c659fcc41522b34aa86d9aeba0237 >echo x - dhcp_probe/pkg-plist >sed 's/^X//' >dhcp_probe/pkg-plist << 'f74463d704e76c7e4c6fdfca6e09ca32' >Xman/man5/dhcp_probe.cf.5.gz >Xman/man8/dhcp_probe.8.gz >Xsbin/dhcp_probe >X@sample etc/dhcp_probe.cf.sample >f74463d704e76c7e4c6fdfca6e09ca32 >exit >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 197162
:
152324
|
152672
|
152673
|
152674
|
152675
|
153335