clean up the remap_file_pages sanitize routine
[trinity.git] / net / irda_setsockopt.c
blob7fa4f9d19c228a61a7692d512f8d1b4bb9d67d2a
1 #include <stdlib.h>
2 #include <sys/socket.h> /* old irda.h is broken */
4 /* old irda.h does not include something which defines sa_family_t */
5 #include <netinet/in.h>
7 #include <linux/irda.h>
8 #include "net.h"
9 #include "maps.h" // page_rand
10 #include "compat.h"
11 #include "utils.h" // ARRAY_SIZE
13 #define NR_SOL_IRDA_OPTS ARRAY_SIZE(irda_opts)
14 static const unsigned int irda_opts[] = {
15 IRLMP_ENUMDEVICES, IRLMP_IAS_SET, IRLMP_IAS_QUERY, IRLMP_HINTS_SET,
16 IRLMP_QOS_SET, IRLMP_QOS_GET, IRLMP_MAX_SDU_SIZE, IRLMP_IAS_GET,
17 IRLMP_IAS_DEL, IRLMP_HINT_MASK_SET, IRLMP_WAITDEVICE };
19 void irda_setsockopt(struct sockopt *so)
21 unsigned char val;
23 so->level = SOL_IRDA;
25 val = rand() % NR_SOL_IRDA_OPTS;
26 so->optname = irda_opts[val];