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 <afsconfig.h>
17 #include <afs/param.h>
20 #include <sys/types.h>
24 #include <netinet/in.h>
28 #include <afs/ptclient.h>
32 acl_HtonACL(struct acl_accessList *acl)
34 /* Converts the access list defined by acl to network order. Returns 0 always. */
38 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 acl_NtohACL(struct acl_accessList *acl)
58 /* Converts the access list defined by acl to network order. Returns 0 always. */
62 return (0); /* no swapping needed */
63 acl->size = ntohl(acl->size);
64 acl->version = ntohl(acl->version);
65 acl->total = ntohl(acl->total);
66 acl->positive = ntohl(acl->positive);
67 acl->negative = ntohl(acl->negative);
68 for (i = 0; i < acl->positive; i++) {
69 acl->entries[i].id = ntohl(acl->entries[i].id);
70 acl->entries[i].rights = ntohl(acl->entries[i].rights);
72 for (i = acl->total - 1; i >= acl->total - acl->negative; i--) {
73 acl->entries[i].id = ntohl(acl->entries[i].id);
74 acl->entries[i].rights = ntohl(acl->entries[i].rights);