X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=include%2Ftr_rp_client.h;fp=include%2Ftr_rp_client.h;h=1ff4b29e5d72eb669a9a6a02b47d336f235c8d63;hp=0000000000000000000000000000000000000000;hb=6f65c9cce86719147d0b4dcc9823b25443c2d185;hpb=eaa1a8ceed54fbfadc2638cf383aaa12ab446a57 diff --git a/include/tr_rp_client.h b/include/tr_rp_client.h new file mode 100644 index 0000000..1ff4b29 --- /dev/null +++ b/include/tr_rp_client.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2012-2018, JANET(UK) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of JANET(UK) nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef TRUST_ROUTER_TR_RP_CLIENT_H +#define TRUST_ROUTER_TR_RP_CLIENT_H + +#include + +#include +#include + +typedef struct tr_rp_client { + struct tr_rp_client *next; + struct tr_rp_client *comm_next; + TR_GSS_NAMES *gss_names; + TR_FILTER_SET *filters; +} TR_RP_CLIENT; + +typedef struct tr_rp_client *TR_RP_CLIENT_ITER; + +/* tr_rp_client.c */ +TR_RP_CLIENT *tr_rp_client_new(TALLOC_CTX *mem_ctx); +void tr_rp_client_free(TR_RP_CLIENT *client); +TR_RP_CLIENT *tr_rp_client_add_func(TR_RP_CLIENT *clients, TR_RP_CLIENT *new); +#define tr_rp_client_add(clients,new) ((clients)=tr_rp_client_add_func((clients),(new))) +int tr_rp_client_add_gss_name(TR_RP_CLIENT *client, TR_NAME *name); +int tr_rp_client_set_filters(TR_RP_CLIENT *client, TR_FILTER_SET *filts); +TR_RP_CLIENT_ITER *tr_rp_client_iter_new(TALLOC_CTX *memctx); +void tr_rp_client_iter_free(TR_RP_CLIENT_ITER *iter); +TR_RP_CLIENT *tr_rp_client_iter_first(TR_RP_CLIENT_ITER *iter, TR_RP_CLIENT *rp_clients); +TR_RP_CLIENT *tr_rp_client_iter_next(TR_RP_CLIENT_ITER *iter); +TR_RP_CLIENT *tr_rp_client_lookup(TR_RP_CLIENT *rp_clients, TR_NAME *gss_name); + +/* tr_rp_client_encoders.c */ +json_t *tr_rp_clients_to_json(TR_RP_CLIENT *rp_clients); + +#endif //TRUST_ROUTER_TR_RP_CLIENT_H