Lines Matching refs:msg
100 #define NGF_ORIG 0x00000000 /* the msg is the original request */
375 * Allocate and initialize a netgraph message "msg" with "len"
376 * extra bytes of argument. Sets "msg" to NULL if fails.
379 #define NG_MKMESSAGE(msg, cookie, cmdid, len, how) \
381 (msg) = malloc(sizeof(struct ng_mesg) \
383 if ((msg) == NULL) \
385 (msg)->header.version = NG_VERSION; \
386 (msg)->header.typecookie = (cookie); \
387 (msg)->header.cmd = (cmdid); \
388 (msg)->header.arglen = (len); \
389 strncpy((msg)->header.cmdstr, #cmdid, \
390 sizeof((msg)->header.cmdstr) - 1); \
394 * Allocate and initialize a response "rsp" to a message "msg"
397 #define NG_MKRESPONSE(rsp, msg, len, how) \
405 (rsp)->header.token = (msg)->header.token; \
406 (rsp)->header.typecookie = (msg)->header.typecookie; \
407 (rsp)->header.cmd = (msg)->header.cmd; \
408 bcopy((msg)->header.cmdstr, (rsp)->header.cmdstr, \
416 #define NG_COPYMESSAGE(copy, msg, how) \
419 + (msg)->header.arglen, M_NETGRAPH_MSG, (how) | M_ZERO); \
423 (copy)->header.arglen = (msg)->header.arglen; \
424 (copy)->header.token = (msg)->header.token; \
425 (copy)->header.typecookie = (msg)->header.typecookie; \
426 (copy)->header.cmd = (msg)->header.cmd; \
427 (copy)->header.flags = (msg)->header.flags; \
428 bcopy((msg)->header.cmdstr, (copy)->header.cmdstr, \
430 if ((msg)->header.arglen > 0) \
431 bcopy((msg)->data, (copy)->data, (msg)->header.arglen); \