summaryrefslogtreecommitdiff
path: root/pfinet/stubs.c
blob: e610cbc980dd6d72b3edca9560b681b489f0b489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* Stub functions replacing things called from the Linux code
   Copyright (C) 2000 Free Software Foundation, Inc.

   This file is part of the GNU Hurd.

   The GNU Hurd is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2, or (at
   your option) any later version.

   The GNU Hurd is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */

#include "pfinet.h"

#include <stdlib.h>
#include <unistd.h>

#include <linux/types.h>
#include <linux/socket.h>
#include <net/sock.h>
#include <net/pkt_sched.h>

int qdisc_restart(struct device *dev)
{
  return 0;
}

void qdisc_run_queues(void)
{
}

struct Qdisc_head qdisc_head;
struct Qdisc qdisc_stub;

void
dev_init_scheduler (struct device *dev)
{
  dev->qdisc = &qdisc_stub;
}
#pragma weak dev_shutdown = dev_init_scheduler
#pragma weak dev_activate = dev_init_scheduler
#pragma weak dev_deactivate = dev_init_scheduler
#pragma weak tcp_ioctl = dev_init_scheduler

/* This isn't quite a stub, but it's not quite right either.  */
__u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr,
				 __u16 sport, __u16 dport)
{
  static u32 tcp_iss;
  static time_t last;
  struct timeval now;

  do_gettimeofday (&now);

  if (now.tv_sec - last > 300)
    {
      last = now.tv_sec;
      srandom (getpid () ^ now.tv_sec ^ now.tv_usec);
      tcp_iss = random ();
    }

  return tcp_iss + (now.tv_sec * 1000000) + now.tv_usec;
}