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>
9 #include "maps.h" // page_rand
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
)
25 val
= rand() % NR_SOL_IRDA_OPTS
;
26 so
->optname
= irda_opts
[val
];