LEFT | RIGHT |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2012 INRIA | 3 * Copyright (c) 2012 INRIA |
4 * | 4 * |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 ret = connect (control_fd, (struct sockaddr *) &addr, | 120 ret = connect (control_fd, (struct sockaddr *) &addr, |
121 sizeof(struct sockaddr_un)); | 121 sizeof(struct sockaddr_un)); |
122 ABORT_IF (ret == -1, "Could not connect to Vsys control socket", 0); | 122 ABORT_IF (ret == -1, "Could not connect to Vsys control socket", 0); |
123 | 123 |
124 /* passing type param */ | 124 /* passing type param */ |
125 ret = send (control_fd, (const char *)&iftype, sizeof(iftype), 0); | 125 ret = send (control_fd, (const char *)&iftype, sizeof(iftype), 0); |
126 ABORT_IF (ret != sizeof(iftype), "Could not send paramater to Vsys control soc
ket", 0); | 126 ABORT_IF (ret != sizeof(iftype), "Could not send paramater to Vsys control soc
ket", 0); |
127 | 127 |
128 return ReceiveVifFd (control_fd, if_name); | 128 return ReceiveVifFd (control_fd, if_name); |
129 | |
130 } | 129 } |
131 | 130 |
132 /** | 131 /** |
133 * | 132 * |
134 * Sets the TAP/TUN interface up. | 133 * Sets the TAP/TUN interface up. |
135 * When a TAP/TUN device is created on PlanetLab it must be set up | 134 * When a TAP/TUN device is created on PlanetLab it must be set up |
136 * writing some configuration information to the vsys fifo at /vsys/vif_up.in | 135 * writing some configuration information to the vsys fifo at /vsys/vif_up.in |
137 * | 136 * |
138 */ | 137 */ |
139 void | 138 void |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // set the TAP interface up | 224 // set the TAP interface up |
226 SetTunUp (ip, prefix, (const char*)if_name); | 225 SetTunUp (ip, prefix, (const char*)if_name); |
227 | 226 |
228 // | 227 // |
229 // Send the socket back to the tap net device so it can go about its business | 228 // Send the socket back to the tap net device so it can go about its business |
230 // | 229 // |
231 SendSocket (path, fd, PLANETLAB_MAGIC); | 230 SendSocket (path, fd, PLANETLAB_MAGIC); |
232 | 231 |
233 return 0; | 232 return 0; |
234 } | 233 } |
LEFT | RIGHT |