~ubuntu-branches/debian/sid/trinity/sid

« back to all changes in this revision

Viewing changes to net/proto-pppol2tp.c

  • Committer: Package Import Robot
  • Author(s): gustavo panizzo
  • Date: 2014-01-17 21:10:15 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140117211015-k2qbnpu0osa5mlil
Tags: 1.3-1
* New upstream version 1.3.
* Removed wrong dependency on linux-headers. (Closes: #733771).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdlib.h>
 
2
#include <netinet/in.h>
 
3
#include <linux/if_pppol2tp.h>
 
4
#include "net.h"
 
5
#include "compat.h"
 
6
#include "utils.h"      // ARRAY_SIZE
 
7
 
 
8
#define SOL_PPPOL2TP 273
 
9
 
 
10
#define NR_SOL_PPPOL2TP_OPTS ARRAY_SIZE(pppol2tp_opts)
 
11
static const unsigned int pppol2tp_opts[] = {
 
12
        PPPOL2TP_SO_DEBUG, PPPOL2TP_SO_RECVSEQ, PPPOL2TP_SO_SENDSEQ, PPPOL2TP_SO_LNSMODE,
 
13
        PPPOL2TP_SO_REORDERTO };
 
14
 
 
15
void pppol2tp_setsockopt(struct sockopt *so)
 
16
{
 
17
        unsigned char val;
 
18
 
 
19
        so->level = SOL_PPPOL2TP;
 
20
 
 
21
        val = rand() % NR_SOL_PPPOL2TP_OPTS;
 
22
        so->optname = pppol2tp_opts[val];
 
23
 
 
24
        so->optval = sizeof(int);
 
25
}