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>
23 #include <afs/ptclient.h>
28 acl_HtonACL(struct acl_accessList *acl)
30 /* Converts the access list defined by acl to network order. Returns 0 always. */
34 return (0); /* no swapping needed */
35 for (i = 0; i < acl->positive; i++) {
36 acl->entries[i].id = htonl(acl->entries[i].id);
37 acl->entries[i].rights = htonl(acl->entries[i].rights);
39 for (i = acl->total - 1; i >= acl->total - acl->negative; i--) {
40 acl->entries[i].id = htonl(acl->entries[i].id);
41 acl->entries[i].rights = htonl(acl->entries[i].rights);
43 acl->size = htonl(acl->size);
44 acl->version = htonl(acl->version);
45 acl->total = htonl(acl->total);
46 acl->positive = htonl(acl->positive);
47 acl->negative = htonl(acl->negative);
52 acl_NtohACL(struct acl_accessList *acl)
54 /* Converts the access list defined by acl to network order. Returns 0 always. */
58 return (0); /* no swapping needed */
59 acl->size = ntohl(acl->size);
60 acl->version = ntohl(acl->version);
61 acl->total = ntohl(acl->total);
62 acl->positive = ntohl(acl->positive);
63 acl->negative = ntohl(acl->negative);
64 for (i = 0; i < acl->positive; i++) {
65 acl->entries[i].id = ntohl(acl->entries[i].id);
66 acl->entries[i].rights = ntohl(acl->entries[i].rights);
68 for (i = acl->total - 1; i >= acl->total - acl->negative; i--) {
69 acl->entries[i].id = ntohl(acl->entries[i].id);
70 acl->entries[i].rights = ntohl(acl->entries[i].rights);