1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
--- 24 unchanged lines hidden (view full) ---
33 */
34
35#include "dev/net/ethertap.hh"
36
37#if defined(__OpenBSD__) || defined(__APPLE__)
38#include <sys/param.h>
39
40#endif
41#include <netinet/in.h>
42#include <unistd.h>
43
44#include <deque>
45#include <string>
46
47#include "base/misc.hh"
48#include "base/pollevent.hh"
49#include "base/socket.hh"
50#include "base/trace.hh"
51#include "debug/Ethernet.hh"
--- 320 unchanged lines hidden (view full) ---
372 uint32_t frame_len = htonl(len);
373 ssize_t ret = write(socket, &frame_len, sizeof(frame_len));
374 if (ret != sizeof(frame_len))
375 return false;
376 return write(socket, data, len) == len;
377}
378
379
380EtherTapStub *
381EtherTapStubParams::create()
382{
383 return new EtherTapStub(this);
384}
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;
--- 24 unchanged lines hidden (view full) ---
33 */
34
35#include "dev/net/ethertap.hh"
36
37#if defined(__OpenBSD__) || defined(__APPLE__)
38#include <sys/param.h>
39
40#endif
41#include <netinet/in.h>
42#include <unistd.h>
43
44#include <deque>
45#include <string>
46
47#include "base/misc.hh"
48#include "base/pollevent.hh"
49#include "base/socket.hh"
50#include "base/trace.hh"
51#include "debug/Ethernet.hh"
--- 320 unchanged lines hidden (view full) ---
372 uint32_t frame_len = htonl(len);
373 ssize_t ret = write(socket, &frame_len, sizeof(frame_len));
374 if (ret != sizeof(frame_len))
375 return false;
376 return write(socket, data, len) == len;
377}
378
379
380EtherTapStub *
381EtherTapStubParams::create()
382{
383 return new EtherTapStub(this);
384}