| 1 | /* |
| 2 | * Component of the D-ITG 2.8.1 (r1023) platform (http://traffic.comics.unina.it/software/ITG) |
| 3 | * |
| 4 | * Copyright : (C) 2004-2013 by Alessio Botta, Walter de Donato, Alberto Dainotti, |
| 5 | * Stefano Avallone, Antonio Pescape' (PI) |
| 6 | * COMICS (COMputer for Interaction and CommunicationS) Group |
| 7 | * Department of Electrical Engineering and Information Technologies |
| 8 | * University of Napoli "Federico II". |
| 9 | * email : [email protected], [email protected], [email protected], |
| 10 | * [email protected], [email protected] |
| 11 | * |
| 12 | * This program is free software: you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by |
| 14 | * the Free Software Foundation, either version 3 of the License, or |
| 15 | * (at your option) any later version. |
| 16 | * |
| 17 | * This program is distributed in the hope that it will be useful, |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | * GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License |
| 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 24 | * |
| 25 | * For commercial use please refer to D-ITG Professional. |
| 26 | */ |
| 27 | |
| 28 | |
| 29 | #define PIPE_BUFSIZE 1000 |
| 30 | #define PIPE_TIMEOUT 100000 |
| 31 | extern char nameProgram[]; |
| 32 | |
| 33 | struct pipeMsg { |
| 34 | int flowId; |
| 35 | int code; |
| 36 | }; |
| 37 | |
| 38 | #ifdef WIN32 |
| 39 | extern HANDLE mutex_numPipes; |
| 40 | extern int numPipes; |
| 41 | #endif |
| 42 | |
| 43 | #ifdef UNIX |
| 44 | int createNewPipe(int fd[2]); |
| 45 | int sendPipeMsg(int fd[2], pipeMsg *msg); |
| 46 | int recvPipeMsg(int fd[2], pipeMsg *msg); |
| 47 | int closePipe(int fd[2]); |
| 48 | #endif |
| 49 | #ifdef WIN32 |
| 50 | int createNewPipe(HANDLE pipe[3]); |
| 51 | int sendPipeMsg(HANDLE pipe[3], pipeMsg *msg); |
| 52 | int recvPipeMsg(HANDLE pipe[3], pipeMsg *msg); |
| 53 | int closePipe(HANDLE fd[3]); |
| 54 | #endif |
| 55 |