netdump_client.c (0a90043e63d3d3fe0b39a05794af5ea0e0e05938) netdump_client.c (489ba2223676ec251ab1bfe2906d2a62959c8ce3)
1/*-
2 * Copyright (c) 2005-2014 Sandvine Incorporated. All rights reserved.
3 * Copyright (c) 2000 Darrell Anderson
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 75 unchanged lines hidden (view full) ---

84 if (nd_debug > 1) \
85 printf(("%s: " f), __func__, ## __VA_ARGS__); \
86} while (0)
87
88static void netdump_cleanup(void);
89static int netdump_configure(struct diocskerneldump_arg *,
90 struct thread *);
91static int netdump_dumper(void *priv __unused, void *virtual,
1/*-
2 * Copyright (c) 2005-2014 Sandvine Incorporated. All rights reserved.
3 * Copyright (c) 2000 Darrell Anderson
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 75 unchanged lines hidden (view full) ---

84 if (nd_debug > 1) \
85 printf(("%s: " f), __func__, ## __VA_ARGS__); \
86} while (0)
87
88static void netdump_cleanup(void);
89static int netdump_configure(struct diocskerneldump_arg *,
90 struct thread *);
91static int netdump_dumper(void *priv __unused, void *virtual,
92 vm_offset_t physical __unused, off_t offset, size_t length);
92 off_t offset, size_t length);
93static bool netdump_enabled(void);
94static int netdump_enabled_sysctl(SYSCTL_HANDLER_ARGS);
95static int netdump_ioctl(struct cdev *dev __unused, u_long cmd,
96 caddr_t addr, int flags __unused, struct thread *td);
97static int netdump_modevent(module_t mod, int type, void *priv);
98static int netdump_start(struct dumperinfo *di, void *key,
99 uint32_t keysize);
100static void netdump_unconfigure(void);

--- 121 unchanged lines hidden (view full) ---

222/*
223 * Callback from dumpsys() to dump a chunk of memory.
224 * Copies it out to our static buffer then sends it across the network.
225 * Detects the initial KDH and makes sure it is given a special packet type.
226 *
227 * Parameters:
228 * priv Unused. Optional private pointer.
229 * virtual Virtual address (where to read the data from)
93static bool netdump_enabled(void);
94static int netdump_enabled_sysctl(SYSCTL_HANDLER_ARGS);
95static int netdump_ioctl(struct cdev *dev __unused, u_long cmd,
96 caddr_t addr, int flags __unused, struct thread *td);
97static int netdump_modevent(module_t mod, int type, void *priv);
98static int netdump_start(struct dumperinfo *di, void *key,
99 uint32_t keysize);
100static void netdump_unconfigure(void);

--- 121 unchanged lines hidden (view full) ---

222/*
223 * Callback from dumpsys() to dump a chunk of memory.
224 * Copies it out to our static buffer then sends it across the network.
225 * Detects the initial KDH and makes sure it is given a special packet type.
226 *
227 * Parameters:
228 * priv Unused. Optional private pointer.
229 * virtual Virtual address (where to read the data from)
230 * physical Unused. Physical memory address.
231 * offset Offset from start of core file
232 * length Data length
233 *
234 * Return value:
235 * 0 on success
236 * errno on error
237 */
238static int
230 * offset Offset from start of core file
231 * length Data length
232 *
233 * Return value:
234 * 0 on success
235 * errno on error
236 */
237static int
239netdump_dumper(void *priv __unused, void *virtual,
240 vm_offset_t physical __unused, off_t offset, size_t length)
238netdump_dumper(void *priv __unused, void *virtual, off_t offset, size_t length)
241{
242 int error;
243
244 NETDDEBUGV("netdump_dumper(NULL, %p, NULL, %ju, %zu)\n",
245 virtual, (uintmax_t)offset, length);
246
247 if (virtual == NULL) {
248 error = netdump_flush_buf();

--- 506 unchanged lines hidden ---
239{
240 int error;
241
242 NETDDEBUGV("netdump_dumper(NULL, %p, NULL, %ju, %zu)\n",
243 virtual, (uintmax_t)offset, length);
244
245 if (virtual == NULL) {
246 error = netdump_flush_buf();

--- 506 unchanged lines hidden ---