/* * Copyright (c) 2017 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file bent_pipe.h * @brief <#Brief Description#> * * PF_UNIX "forwarder" for testing. It's a bent pipe. Whatever comes down * one connection goes up all the others. * * It runs in its own thread and uses an event model. * * We capture SIG_PIPE when doing a write so this test code does not * trigger a process-wide SIG_PIPE. Unless we have SO_SIGPIPE, then we'll use that. * */ #ifndef Libccnx_bent_pipe_h #define Libccnx_bent_pipe_h #include struct bentpipe_state; /** * * @see bentpipe_Create */ typedef struct bentpipe_state BentPipeState; /** * <#One Line Description#> * * <#Paragraphs Of Explanation#> * * @param [<#in out in,out#>] <#name#> <#description#> * * @return <#value#> <#explanation#> * * Example: * @code * <#example#> * @endcode * * @see <#references#> */ BentPipeState *bentpipe_Create(const char *local_name); /** * <#One Line Description#> * * <#Paragraphs Of Explanation#> * * @param [<#in out in,out#>] <#name#> <#description#> * * @return <#value#> <#explanation#> * * Example: * @code * <#example#> * @endcode * * @see <#references#> */ void bentpipe_Destroy(BentPipeState **statePtr); /** * <#One Line Description#> * * <#Paragraphs Of Explanation#> * * @param [<#in out in,out#>] <#name#> <#description#> * * @return <#value#> <#explanation#> * * Example: * @code * <#example#> * @endcode * * @see <#references#> */ int bentpipe_Start(BentPipeState *bp); /** * <#One Line Description#> * * <#Paragraphs Of Explanation#> * * @param [<#in out in,out#>] <#name#> <#description#> * * @return <#value#> <#explanation#> * * Example: * @code * <#example#> * @endcode * * @see <#references#> */ int bentpipe_Stop(BentPipeState *bp); /** * <#One Line Description#> * * <#Paragraphs Of Explanation#> * * @param [<#in out in,out#>] <#name#> <#description#> * * @return <#value#> <#explanation#> * * Example: * @code * <#example#> * @endcode * * @see <#references#> */ void bentpipe_SetChattyOutput(BentPipeState *bp, bool chattyOutput); /** * <#One Line Description#> * * <#Paragraphs Of Explanation#> * * @param [<#in out in,out#>] <#name#> <#description#> * * @return <#value#> <#explanation#> * * Example: * @code * <#example#> * @endcode * * @see <#references#> */ int bentpipe_Params(BentPipeState *bp, double loss_rate, unsigned buffer_bytes, double mean_sec_delay, double bytes_per_sec); #endif // Libccnx_bent_pipe_h