etherint.cc (12334:e0ab29a34764) etherint.cc (13782:9f6654f478e2)
1/*
2 * Copyright (c) 2002-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;

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

29 */
30
31#include "dev/net/etherint.hh"
32
33#include "base/logging.hh"
34#include "sim/sim_object.hh"
35
36void
1/*
2 * Copyright (c) 2002-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;

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

29 */
30
31#include "dev/net/etherint.hh"
32
33#include "base/logging.hh"
34#include "sim/sim_object.hh"
35
36void
37EtherInt::bind(Port &peer)
38{
39 EtherInt *p = dynamic_cast<EtherInt *>(&peer);
40 if (!p) {
41 fatal("Attempt to bind port %s to non-ethernet port %s.",
42 name(), peer.name());
43 }
44 setPeer(p);
45 _connected = true;
46}
47
48void
49EtherInt::unbind()
50{
51 peer = nullptr;
52 _connected = false;
53}
54
55void
37EtherInt::setPeer(EtherInt *p)
38{
39 if (peer && peer != p)
40 panic("You cannot change the peer once it is set.\n"
41 "Current peer=%s Desired peer=%s", peer->name(), p->name());
42
43 peer = p;
44}
56EtherInt::setPeer(EtherInt *p)
57{
58 if (peer && peer != p)
59 panic("You cannot change the peer once it is set.\n"
60 "Current peer=%s Desired peer=%s", peer->name(), p->name());
61
62 peer = p;
63}