4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 * Copyright 2012 Milan Jurik. All rights reserved.
25 */
26
27
28 /*
29 * Token processing for sysupd; each token function does one
30 * or more operations. All of them bump the buffer pointer
31 * to the next token; some of them extract one or more data
32 * from the token.
33 */
34
35 #define DEBUG 0
36 #if DEBUG
37 #define DPRINT(x) { (void) fprintf x; }
38 #else
39 #define DPRINT(x)
40 #endif
41
42 #include <locale.h>
43 #include <stdlib.h>
44 #include <stdio.h>
1506 adrm_char(&(ctx->adr), &c, 1);
1507
1508 ctx->adr.adr_now += sizeof (ushort_t); /* classification */
1509 ctx->adr.adr_now += 4 * c; /* compartments */
1510
1511 return (0);
1512 }
1513
1514 /*
1515 * Format of useofpriv token:
1516 * priv_type adr_char
1517 * priv_set_t adr_short
1518 * priv_set adr_char*(sizeof (priv_set_t))
1519 */
1520 int
1521 useofpriv_token(parse_context_t *ctx)
1522 {
1523 ctx->adr.adr_now += sizeof (char); /* success / fail */
1524 skip_bytes(ctx);
1525
1526 return (0);
1527 }
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 *
25 * Copyright 2012 Milan Jurik. All rights reserved.
26 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
27 */
28
29
30 /*
31 * Token processing for sysupd; each token function does one
32 * or more operations. All of them bump the buffer pointer
33 * to the next token; some of them extract one or more data
34 * from the token.
35 */
36
37 #define DEBUG 0
38 #if DEBUG
39 #define DPRINT(x) { (void) fprintf x; }
40 #else
41 #define DPRINT(x)
42 #endif
43
44 #include <locale.h>
45 #include <stdlib.h>
46 #include <stdio.h>
1508 adrm_char(&(ctx->adr), &c, 1);
1509
1510 ctx->adr.adr_now += sizeof (ushort_t); /* classification */
1511 ctx->adr.adr_now += 4 * c; /* compartments */
1512
1513 return (0);
1514 }
1515
1516 /*
1517 * Format of useofpriv token:
1518 * priv_type adr_char
1519 * priv_set_t adr_short
1520 * priv_set adr_char*(sizeof (priv_set_t))
1521 */
1522 int
1523 useofpriv_token(parse_context_t *ctx)
1524 {
1525 ctx->adr.adr_now += sizeof (char); /* success / fail */
1526 skip_bytes(ctx);
1527
1528 return (0);
1529 }
1530
1531 /*
1532 * Format of access_mask token:
1533 * access_mask adr_u_int32
1534 */
1535 int
1536 access_mask_token(parse_context_t *ctx)
1537 {
1538 ctx->adr.adr_now += sizeof (uint32_t);
1539
1540 return (0);
1541 }
1542
1543 /*
1544 * Format of wsid token:
1545 * wsid adr_string
1546 */
1547 int
1548 wsid_token(parse_context_t *ctx)
1549 {
1550 skip_bytes(ctx);
1551
1552 return (0);
1553 }
|