flags.c (1e6455d87088ac9723523093cbec92d12c0146de) flags.c (a826eb5a413324c5136f5094650cb15c8331c93f)
1/*
2 * Copyright (c) 2006 "David Kirchner" <dpk@dpk.net>. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 1145 unchanged lines hidden (view full) ---

1154 for (t = caprights; t->str != NULL; t++) {
1155 if (cap_rights_is_set(rightsp, t->val)) {
1156 fprintf(fp, "%s%s", comma ? "," : "", t->str);
1157 comma = true;
1158 }
1159 }
1160}
1161
1/*
2 * Copyright (c) 2006 "David Kirchner" <dpk@dpk.net>. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 1145 unchanged lines hidden (view full) ---

1154 for (t = caprights; t->str != NULL; t++) {
1155 if (cap_rights_is_set(rightsp, t->val)) {
1156 fprintf(fp, "%s%s", comma ? "," : "", t->str);
1157 comma = true;
1158 }
1159 }
1160}
1161
1162static struct name_table cmsgtypeip[] = {
1163 X(IP_RECVDSTADDR) X(IP_RECVTTL) X(IP_RECVOPTS) X(IP_RECVRETOPTS)
1164 X(IP_RECVIF) X(IP_RECVTOS) X(IP_FLOWID) X(IP_FLOWTYPE)
1165 X(IP_RSSBUCKETID) XEND
1166};
1167
1168static struct name_table cmsgtypeipv6[] = {
1169#if 0
1170 /* The RFC 2292 defines are kernel space only. */
1171 X(IPV6_2292PKTINFO) X(IPV6_2292HOPLIMIT) X(IPV6_2292HOPOPTS)
1172 X(IPV6_2292DSTOPTS) X(IPV6_2292RTHDR) X(IPV6_2292NEXTHOP)
1173#endif
1174 X(IPV6_PKTINFO) X(IPV6_HOPLIMIT) X(IPV6_HOPOPTS)
1175 X(IPV6_DSTOPTS) X(IPV6_RTHDR) X(IPV6_NEXTHOP)
1176 X(IPV6_TCLASS) X(IPV6_FLOWID) X(IPV6_FLOWTYPE) X(IPV6_RSSBUCKETID)
1177 X(IPV6_PATHMTU) X(IPV6_RTHDRDSTOPTS) X(IPV6_USE_MIN_MTU)
1178 X(IPV6_DONTFRAG) X(IPV6_PREFER_TEMPADDR) XEND
1179};
1180
1181static struct name_table cmsgtypesctp[] = {
1182 X(SCTP_INIT) X(SCTP_SNDRCV) X(SCTP_EXTRCV) X(SCTP_SNDINFO)
1183 X(SCTP_RCVINFO) X(SCTP_NXTINFO) X(SCTP_PRINFO) X(SCTP_AUTHINFO)
1184 X(SCTP_DSTADDRV4) X(SCTP_DSTADDRV6) XEND
1185};
1186
1162const char *
1187const char *
1188sysdecode_cmsg_type(int cmsg_level, int cmsg_type)
1189{
1190
1191 if (cmsg_level == SOL_SOCKET)
1192 return (lookup_value(cmsgtypesocket, cmsg_type));
1193 if (cmsg_level == IPPROTO_IP)
1194 return (lookup_value(cmsgtypeip, cmsg_type));
1195 if (cmsg_level == IPPROTO_IPV6)
1196 return (lookup_value(cmsgtypeipv6, cmsg_type));
1197 if (cmsg_level == IPPROTO_SCTP)
1198 return (lookup_value(cmsgtypesctp, cmsg_type));
1199 return (NULL);
1200}
1201
1202const char *
1163sysdecode_sctp_pr_policy(int policy)
1164{
1165
1166 return (lookup_value(sctpprpolicy, policy));
1167}
1168
1169static struct name_table sctpsinfoflags[] = {
1170 X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER)

--- 25 unchanged lines hidden ---
1203sysdecode_sctp_pr_policy(int policy)
1204{
1205
1206 return (lookup_value(sctpprpolicy, policy));
1207}
1208
1209static struct name_table sctpsinfoflags[] = {
1210 X(SCTP_EOF) X(SCTP_ABORT) X(SCTP_UNORDERED) X(SCTP_ADDR_OVER)

--- 25 unchanged lines hidden ---