diff options
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/dispatch.c | 4 | ||||
-rw-r--r-- | src/map.c | 15 | ||||
-rw-r--r-- | src/map.h | 19 | ||||
-rw-r--r-- | src/nis.c | 3 | ||||
-rw-r--r-- | src/plugin.c | 4 |
6 files changed, 25 insertions, 22 deletions
diff --git a/src/Makefile b/src/Makefile index de39234..8176f4a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -11,4 +11,4 @@ portmap: portmap.c $(CC) $(CFLAGS) -o $@ -DPORTMAP_MAIN $^ $(LDFLAGS) clean: - $(RM) portmap plugin.so + $(RM) portmap plugin.so dummyplugin.so diff --git a/src/dispatch.c b/src/dispatch.c index 3dd623c..780c0b4 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -35,14 +35,14 @@ struct dispatch_stream_client_params { static void * dispatch_stream_handler_thread(void *arg) { - int fraglen, flags, ret, frag_len, record_len, client; + int flags, frag_len, record_len, client; ssize_t i; int32_t len, nlen; char fragment[65540], record[65536]; struct pollfd pollfd; struct dispatch_stream_client_params *params; struct plugin_state *state; - bool_t done, last; + bool_t last; /* Recover the full set of parameters. */ params = arg; @@ -76,7 +76,6 @@ static struct entry * map_data_find_map_entry(struct plugin_state *state, struct map *map, unsigned int key_len, const char *key) { - int i; struct entry *entry; if (map == NULL) { return NULL; @@ -107,7 +106,6 @@ static struct entry * map_data_find_map_entry_id(struct plugin_state *state, struct map *map, const char *id) { - int i; struct entry *entry; if (map == NULL) { return NULL; @@ -119,17 +117,6 @@ map_data_find_map_entry_id(struct plugin_state *state, } return NULL; } -static struct entry * -map_data_find_entry_id(struct plugin_state *state, - const char *domain_name, const char *map_name, - const char *id) -{ - return map_data_find_map_entry_id(state, - map_data_find_map(state, - domain_name, - map_name), - id); -} /* Query function: check if we have a record for the domain. Return that * information in "supported", and return TRUE unless we ran into internal @@ -275,7 +262,6 @@ map_data_unset_map(struct plugin_state *state, { struct domain *domain; struct map *map; - struct entry *entry, *next; int i; /* Check that we have a domain record that matches. */ domain = map_data_find_domain(state, domain_name); @@ -331,7 +317,6 @@ map_data_set_map(struct plugin_state *state, { struct domain *domain, *domains; struct map *map, *maps; - struct entry *entry, *next; int i; /* Locate the domain for this map. */ domain = NULL; @@ -1,4 +1,5 @@ struct plugin_state; +/* Functions to pull data out of maps. */ void map_init(struct plugin_state *state); bool_t map_supports_domain(struct plugin_state *state, const char *domain, @@ -23,3 +24,21 @@ bool_t map_next(struct plugin_state *state, bool_t map_order(struct plugin_state *state, const char *domain, const char *map, unsigned int *order); +/* Functions to push data into maps. */ +void map_data_clear_map(struct plugin_state *state, + const char *domain_name, const char *map_name); +void map_data_unset_map(struct plugin_state *state, + const char *domain_name, const char *map_name); +void map_data_set_map(struct plugin_state *state, + const char *domain_name, const char *map_name); +void map_data_unset_entry_key(struct plugin_state *state, + const char *domain_name, const char *map_name, + unsigned int key_len, const char *key); +void map_data_unset_entry_id(struct plugin_state *state, + const char *domain_name, const char *map_name, + const char *id); +void map_data_set_entry(struct plugin_state *state, + const char *domain_name, const char *map_name, + const char *id, + unsigned int key_len, char *key, + unsigned int value_len, char *value); @@ -63,7 +63,6 @@ nis_reply_fragment(struct plugin_state *state, int client, bool_t first_fragment, bool_t last_fragment) { uint32_t len; - ssize_t i, sent; if (client_addr != NULL) { /* It's a datagram socket, so there's nothing to do but send * the data by itself. */ @@ -474,7 +473,7 @@ nis_process_request(struct plugin_state *state, int client, AUTH *request_auth, *reply_auth; char reply_buf[64000], auth_buf[64000]; struct rpc_msg request, reply; - int superuser, send_reply, auth_flavor, auth_len; + int superuser, auth_flavor, auth_len; struct ypresp_val reply_val; struct ypresp_key_val reply_key_val; struct ypresp_all reply_all; diff --git a/src/plugin.c b/src/plugin.c index 8f412f1..bf4e979 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -114,7 +114,7 @@ plugin_shutdown(Slapi_PBlock *pb) static int plugin_state_init(struct plugin_state **lstate) { - int sockfd = -1, err, i, j; + int sockfd = -1, err, i; struct plugin_state *state = NULL; PLArenaPool *arena = NULL; struct sockaddr_in sin; @@ -147,7 +147,7 @@ plugin_state_init(struct plugin_state **lstate) * listeners, over both IPv4 and IPv6. */ state->n_listeners = 0; for (i = 0; i < 2; i++) { - int pf, type, fd, one, port, ret; + int pf, type, one, port, ret; const char *sock_desc; /* Before we do anything else, on our second trip through, make * sure that the first socket was created, because we'll need |