2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 Information Technology Center
12 Carnegie-Mellon University
16 #include <afs/param.h>
17 #include <afsconfig.h>
21 #include <sys/types.h>
25 #include <netinet/in.h>
33 struct acl_accessList *acl;
35 /* Converts the access list defined by acl to network order. Returns 0 always. */
38 if (htonl(1) == 1) return(0); /* no swapping needed */
39 for (i = 0; i < acl->positive; i++) {
40 acl->entries[i].id = htonl(acl->entries[i].id);
41 acl->entries[i].rights = htonl(acl->entries[i].rights);
43 for (i = acl->total - 1; i >= acl->total - acl->negative; i--) {
44 acl->entries[i].id = htonl(acl->entries[i].id);
45 acl->entries[i].rights = htonl(acl->entries[i].rights);
47 acl->size = htonl(acl->size);
48 acl->version = htonl(acl->version);
49 acl->total = htonl(acl->total);
50 acl->positive = htonl(acl->positive);
51 acl->negative = htonl(acl->negative);
56 struct acl_accessList *acl;
58 /* Converts the access list defined by acl to network order. Returns 0 always. */
61 if (ntohl(1) == 1) return(0); /* no swapping needed */
62 acl->size = ntohl(acl->size);
63 acl->version = ntohl(acl->version);
64 acl->total = ntohl(acl->total);
65 acl->positive = ntohl(acl->positive);
66 acl->negative = ntohl(acl->negative);
67 for (i = 0; i < acl->positive; i++) {
68 acl->entries[i].id = ntohl(acl->entries[i].id);
69 acl->entries[i].rights = ntohl(acl->entries[i].rights);
71 for (i = acl->total - 1; i >= acl->total - acl->negative; i--) {
72 acl->entries[i].id = ntohl(acl->entries[i].id);
73 acl->entries[i].rights = ntohl(acl->entries[i].rights);