1/*- 2 * Copyright (c) 2000 Alfred Perlstein <alfred@freebsd.org> 3 * Copyright (c) 2000 Paul Saab <ps@freebsd.org> 4 * Copyright (c) 2000 John Baldwin <jhb@freebsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: stable/11/sys/boot/i386/libi386/pxe.c 328889 2018-02-05 17:01:18Z kevans $"); |
31 32#include <stand.h> 33#include <string.h> 34#include <stdarg.h> 35 36#include <netinet/in_systm.h> 37#include <netinet/in.h> 38#include <netinet/udp.h> --- 31 unchanged lines hidden (view full) --- 70static void pxenv_call(int func); 71static void bangpxe_call(int func); 72 73static int pxe_init(void); 74static int pxe_strategy(void *devdata, int flag, daddr_t dblk, 75 size_t size, char *buf, size_t *rsize); 76static int pxe_open(struct open_file *f, ...); 77static int pxe_close(struct open_file *f); |
78static int pxe_print(int verbose); |
79static void pxe_cleanup(void); 80static void pxe_setnfshandle(char *rootpath); 81 82static void pxe_perror(int error); 83static int pxe_netif_match(struct netif *nif, void *machdep_hint); 84static int pxe_netif_probe(struct netif *nif, void *machdep_hint); 85static void pxe_netif_init(struct iodesc *desc, void *machdep_hint); 86static int pxe_netif_get(struct iodesc *desc, void *pkt, size_t len, --- 290 unchanged lines hidden (view full) --- 377 printf("pxe_close: calling netif_close()\n"); 378#endif 379 netif_close(pxe_sock); 380 pxe_sock = -1; 381 } 382 return (0); 383} 384 |
385static int |
386pxe_print(int verbose) 387{ |
388 char line[255]; |
389 if (pxe_call == NULL) |
390 return (0); |
391 |
392 printf("%s devices:", pxedisk.dv_name); 393 if (pager_output("\n") != 0) 394 return (1); 395 if (verbose) { 396 snprintf(line, sizeof(line), " pxe0: %s:%s\n", 397 inet_ntoa(rootip), rootpath); 398 } else { 399 snprintf(line, sizeof(line), " pxe0:\n"); 400 } 401 return (pager_output(line)); |
402} 403 404static void 405pxe_cleanup(void) 406{ 407#ifdef PXE_DEBUG 408 t_PXENV_UNLOAD_STACK *unload_stack_p = 409 (t_PXENV_UNLOAD_STACK *)scratch_buffer; --- 318 unchanged lines hidden --- |