ethertap.cc (12559:55550caed7f0) ethertap.cc (12632:a00c27d2256b)
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;

--- 65 unchanged lines hidden (view full) ---

74class TapEvent : public PollEvent
75{
76 protected:
77 EtherTapBase *tap;
78
79 public:
80 TapEvent(EtherTapBase *_tap, int fd, int e)
81 : PollEvent(fd, e), tap(_tap) {}
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;

--- 65 unchanged lines hidden (view full) ---

74class TapEvent : public PollEvent
75{
76 protected:
77 EtherTapBase *tap;
78
79 public:
80 TapEvent(EtherTapBase *_tap, int fd, int e)
81 : PollEvent(fd, e), tap(_tap) {}
82 virtual void process(int revent) { tap->recvReal(revent); }
82
83 void
84 process(int revent) override
85 {
86 // Ensure that our event queue is active. It may not be since we get
87 // here from the PollQueue whenever a real packet happens to arrive.
88 EventQueue::ScopedMigration migrate(tap->eventQueue());
89
90 tap->recvReal(revent);
91 }
83};
84
85EtherTapBase::EtherTapBase(const Params *p)
86 : EtherObject(p), buflen(p->bufsz), dump(p->dump), event(NULL),
87 interface(NULL),
88 txEvent([this]{ retransmit(); }, "EtherTapBase retransmit")
89{
90 buffer = new uint8_t[buflen];

--- 369 unchanged lines hidden ---
92};
93
94EtherTapBase::EtherTapBase(const Params *p)
95 : EtherObject(p), buflen(p->bufsz), dump(p->dump), event(NULL),
96 interface(NULL),
97 txEvent([this]{ retransmit(); }, "EtherTapBase retransmit")
98{
99 buffer = new uint8_t[buflen];

--- 369 unchanged lines hidden ---