dhclient.c (252506) | dhclient.c (252614) |
---|---|
1/* $OpenBSD: dhclient.c,v 1.63 2005/02/06 17:10:13 krw Exp $ */ 2 3/* 4 * Copyright 2004 Henning Brauer <henning@openbsd.org> 5 * Copyright (c) 1995, 1996, 1997, 1998, 1999 6 * The Internet Software Consortium. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 40 unchanged lines hidden (view full) --- 49 * was moved into a shell script so that as support for more operating 50 * systems is added, it will not be necessary to port and maintain 51 * system-specific configuration code to these operating systems - instead, 52 * the shell script can invoke the native tools to accomplish the same 53 * purpose. 54 */ 55 56#include <sys/cdefs.h> | 1/* $OpenBSD: dhclient.c,v 1.63 2005/02/06 17:10:13 krw Exp $ */ 2 3/* 4 * Copyright 2004 Henning Brauer <henning@openbsd.org> 5 * Copyright (c) 1995, 1996, 1997, 1998, 1999 6 * The Internet Software Consortium. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 40 unchanged lines hidden (view full) --- 49 * was moved into a shell script so that as support for more operating 50 * systems is added, it will not be necessary to port and maintain 51 * system-specific configuration code to these operating systems - instead, 52 * the shell script can invoke the native tools to accomplish the same 53 * purpose. 54 */ 55 56#include <sys/cdefs.h> |
57__FBSDID("$FreeBSD: head/sbin/dhclient/dhclient.c 252506 2013-07-02 13:24:37Z bms $"); | 57__FBSDID("$FreeBSD: head/sbin/dhclient/dhclient.c 252614 2013-07-03 21:45:29Z pjd $"); |
58 59#include "dhcpd.h" 60#include "privsep.h" 61 62#include <net80211/ieee80211_freebsd.h> 63 64#ifndef _PATH_VAREMPTY 65#define _PATH_VAREMPTY "/var/empty" --- 1161 unchanged lines hidden (view full) --- 1227 1228 note("DHCPDISCOVER on %s to %s port %d interval %d", 1229 ip->name, inet_ntoa(sockaddr_broadcast.sin_addr), 1230 ntohs(sockaddr_broadcast.sin_port), 1231 (int)ip->client->interval); 1232 1233 /* Send out a packet. */ 1234 (void)send_packet(ip, &ip->client->packet, ip->client->packet_length, | 58 59#include "dhcpd.h" 60#include "privsep.h" 61 62#include <net80211/ieee80211_freebsd.h> 63 64#ifndef _PATH_VAREMPTY 65#define _PATH_VAREMPTY "/var/empty" --- 1161 unchanged lines hidden (view full) --- 1227 1228 note("DHCPDISCOVER on %s to %s port %d interval %d", 1229 ip->name, inet_ntoa(sockaddr_broadcast.sin_addr), 1230 ntohs(sockaddr_broadcast.sin_port), 1231 (int)ip->client->interval); 1232 1233 /* Send out a packet. */ 1234 (void)send_packet(ip, &ip->client->packet, ip->client->packet_length, |
1235 inaddr_any, &sockaddr_broadcast, NULL); | 1235 inaddr_any, &sockaddr_broadcast); |
1236 1237 add_timeout(cur_time + ip->client->interval, send_discover, ip); 1238} 1239 1240/* 1241 * state_panic gets called if we haven't received any offers in a preset 1242 * amount of time. When this happens, we try to use existing leases 1243 * that haven't yet expired, and failing that, we call the client script --- 214 unchanged lines hidden (view full) --- 1458 ip->client->packet.secs = htons(65535); 1459 } 1460 1461 note("DHCPREQUEST on %s to %s port %d", ip->name, 1462 inet_ntoa(destination.sin_addr), ntohs(destination.sin_port)); 1463 1464 /* Send out a packet. */ 1465 (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, | 1236 1237 add_timeout(cur_time + ip->client->interval, send_discover, ip); 1238} 1239 1240/* 1241 * state_panic gets called if we haven't received any offers in a preset 1242 * amount of time. When this happens, we try to use existing leases 1243 * that haven't yet expired, and failing that, we call the client script --- 214 unchanged lines hidden (view full) --- 1458 ip->client->packet.secs = htons(65535); 1459 } 1460 1461 note("DHCPREQUEST on %s to %s port %d", ip->name, 1462 inet_ntoa(destination.sin_addr), ntohs(destination.sin_port)); 1463 1464 /* Send out a packet. */ 1465 (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, |
1466 from, &destination, NULL); | 1466 from, &destination); |
1467 1468 add_timeout(cur_time + ip->client->interval, send_request, ip); 1469} 1470 1471void 1472send_decline(void *ipp) 1473{ 1474 struct interface_info *ip = ipp; 1475 1476 note("DHCPDECLINE on %s to %s port %d", ip->name, 1477 inet_ntoa(sockaddr_broadcast.sin_addr), 1478 ntohs(sockaddr_broadcast.sin_port)); 1479 1480 /* Send out a packet. */ 1481 (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, | 1467 1468 add_timeout(cur_time + ip->client->interval, send_request, ip); 1469} 1470 1471void 1472send_decline(void *ipp) 1473{ 1474 struct interface_info *ip = ipp; 1475 1476 note("DHCPDECLINE on %s to %s port %d", ip->name, 1477 inet_ntoa(sockaddr_broadcast.sin_addr), 1478 ntohs(sockaddr_broadcast.sin_port)); 1479 1480 /* Send out a packet. */ 1481 (void) send_packet(ip, &ip->client->packet, ip->client->packet_length, |
1482 inaddr_any, &sockaddr_broadcast, NULL); | 1482 inaddr_any, &sockaddr_broadcast); |
1483} 1484 1485void 1486make_discover(struct interface_info *ip, struct client_lease *lease) 1487{ 1488 unsigned char discover = DHCPDISCOVER; 1489 struct tree_cache *options[256]; 1490 struct tree_cache option_elements[256]; --- 1228 unchanged lines hidden --- | 1483} 1484 1485void 1486make_discover(struct interface_info *ip, struct client_lease *lease) 1487{ 1488 unsigned char discover = DHCPDISCOVER; 1489 struct tree_cache *options[256]; 1490 struct tree_cache option_elements[256]; --- 1228 unchanged lines hidden --- |