compat.h: Add if_ether.h symbols for older kernels.
[trinity.git] / net / llc_setsockopt.c
blobd7805b463f6a96901bb003c8f93c694596f47917
1 #include <stdlib.h>
2 #include <net/if.h>
3 #include <linux/llc.h>
4 #include "net.h"
5 #include "maps.h" // page_rand
6 #include "compat.h"
7 #include "config.h"
8 #include "trinity.h" // ARRAY_SIZE
10 #define SOL_LLC 268
12 #ifndef USE_LLC_OPT_PKTINFO
13 #define LLC_OPT_PKTINFO LLC_OPT_UNKNOWN
14 #endif
16 #define NR_SOL_LLC_OPTS ARRAY_SIZE(llc_opts)
17 static const unsigned int llc_opts[] = {
18 LLC_OPT_RETRY, LLC_OPT_SIZE, LLC_OPT_ACK_TMR_EXP, LLC_OPT_P_TMR_EXP,
19 LLC_OPT_REJ_TMR_EXP, LLC_OPT_BUSY_TMR_EXP, LLC_OPT_TX_WIN, LLC_OPT_RX_WIN,
20 LLC_OPT_PKTINFO
23 void llc_setsockopt(struct sockopt *so)
25 unsigned char val;
27 so->level = SOL_LLC;
29 val = rand() % NR_SOL_LLC_OPTS;
30 so->optname = llc_opts[val];