Lines Matching +full:max +full:- +full:msg +full:- +full:size

5 /*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
46 * ASCII string size limits
49 #define NG_TYPESIZ 32 /* max type name len (including null) */
50 #define NG_HOOKSIZ 32 /* max hook name len (including null) */
51 #define NG_NODESIZ 32 /* max node name len (including null) */
52 #define NG_PATHSIZ 512 /* max path len (including null) */
53 #define NG_CMDSTRSIZ 32 /* max command string (including null) */
101 #define NGF_ORIG 0x00000000 /* the msg is the original request */
156 #define NGM_LINK_IS_UP 32 /* e.g. carrier found - no data */
163 #define NGM_DROP_LINK 41 /* drop DTR, etc. - stay in the graph */
329 * we should have the priority of that queue be real (and not -1)
333 u_int queue_priority; /* maybe only low-pri is full. -1 = all*/
376 * Allocate and initialize a netgraph message "msg" with "len"
377 * extra bytes of argument. Sets "msg" to NULL if fails.
380 #define NG_MKMESSAGE(msg, cookie, cmdid, len, how) \ argument
382 (msg) = malloc(sizeof(struct ng_mesg) \
384 if ((msg) == NULL) \
386 (msg)->header.version = NG_VERSION; \
387 (msg)->header.typecookie = (cookie); \
388 (msg)->header.cmd = (cmdid); \
389 (msg)->header.arglen = (len); \
390 strncpy((msg)->header.cmdstr, #cmdid, \
391 sizeof((msg)->header.cmdstr) - 1); \
395 * Allocate and initialize a response "rsp" to a message "msg"
398 #define NG_MKRESPONSE(rsp, msg, len, how) \ argument
404 (rsp)->header.version = NG_VERSION; \
405 (rsp)->header.arglen = (len); \
406 (rsp)->header.token = (msg)->header.token; \
407 (rsp)->header.typecookie = (msg)->header.typecookie; \
408 (rsp)->header.cmd = (msg)->header.cmd; \
409 bcopy((msg)->header.cmdstr, (rsp)->header.cmdstr, \
410 sizeof((rsp)->header.cmdstr)); \
411 (rsp)->header.flags |= NGF_RESP; \
417 #define NG_COPYMESSAGE(copy, msg, how) \ argument
420 + (msg)->header.arglen, M_NETGRAPH_MSG, (how) | M_ZERO); \
423 (copy)->header.version = NG_VERSION; \
424 (copy)->header.arglen = (msg)->header.arglen; \
425 (copy)->header.token = (msg)->header.token; \
426 (copy)->header.typecookie = (msg)->header.typecookie; \
427 (copy)->header.cmd = (msg)->header.cmd; \
428 (copy)->header.flags = (msg)->header.flags; \
429 bcopy((msg)->header.cmdstr, (copy)->header.cmdstr, \
430 sizeof((copy)->header.cmdstr)); \
431 if ((msg)->header.arglen > 0) \
432 bcopy((msg)->data, (copy)->data, (msg)->header.arglen); \