ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/util.C
(Generate patch)

Comparing gvpe/src/util.C (file contents):
Revision 1.8 by pcg, Tue Oct 14 15:48:15 2003 UTC vs.
Revision 1.11 by pcg, Thu Oct 16 02:41:21 2003 UTC

1/* 1/*
2 util.C -- process management and other utility functions 2 util.C -- process management and other utility functions
3 Copyright (C) 2003 Marc Lehmann <pcg@goof.com>
3 4
4 Some of these are taken from tinc, see the AUTHORS file. 5 Some of these are taken from tinc, see the AUTHORS file.
5 6
6 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
28#include <sys/types.h> 29#include <sys/types.h>
29#include <sys/wait.h> 30#include <sys/wait.h>
30#include <unistd.h> 31#include <unistd.h>
31#include <time.h> 32#include <time.h>
32 33
33#include <sys/mman.h>
34
35#include "netcompat.h" 34#include "netcompat.h"
36 35
37#include "gettext.h" 36#include "gettext.h"
38#include "pidfile.h" 37#include "pidfile.h"
39#include "dropin.h" 38#include "dropin.h"
204 203
205 return res; 204 return res;
206} 205}
207#endif 206#endif
208 207
208void
209id2mac (unsigned int id, void *m)
210{
211 mac &p = *(mac *)m;
212
213 if (id)
214 {
215 p[0] = 0xfe;
216 p[1] = 0xfd;
217 p[2] = 0x80;
218 p[3] = 0x00;
219 p[4] = id >> 8;
220 p[5] = id;
221 }
222 else
223 {
224 p[0] = 0xff;
225 p[1] = 0xff;
226 p[2] = 0xff;
227 p[3] = 0xff;
228 p[4] = 0xff;
229 p[5] = 0xff;
230 }
231}
232

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines