Lines Matching refs:nbp_req
163 nbp_req_t nbp_req;
174 nbp_req.response = NULL;
175 nbp_req.request = m;
176 nbp_req.space_unused = nbp_req.flags = 0;
198 if (nbp_validate_n_hash (&nbp_req, TRUE, FALSE) == 0) {
199 nbp_req.func = nbp_lkup_reply;
200 (void) nbp_search_nve(&nbp_req, ifID);
201 if (nbp_req.response) {
202 nbp_send_resp(&nbp_req);
208 strlcpy(zone,nbp_req.nve.zone.str, sizeof(zone));
209 strlcpy(object,nbp_req.nve.object.str, sizeof(object));
210 strlcpy(type,nbp_req.nve.type.str, sizeof(type));
484 static int nbp_validate_n_hash (nbp_req, wild_ok, checkLocal)
485 register nbp_req_t *nbp_req;
493 tuple = DATA_NBP(nbp_req->request)->tuple;
494 nbp_req->flags = 0;
531 nbp_req->nve.zone.len = zone->len;
532 nbp_req->nve.zone_hash = 0;
533 bcopy(zone->str,nbp_req->nve.zone.str, zone->len);
545 nbp_req->nve.zone_hash = nbp_strhash(& nbp_req->nve.zone);
548 nbp_req->nve.address = tuple->enu_addr;
549 nbp_req->nve.object.len = object->len;
550 nbp_req->nve.object_hash = 0;
554 nbp_req->flags |= NBP_WILD_OBJECT;
579 nbp_req->nve.object.str[i] = object->str[i];
582 nbp_req->nve.object_hash =
583 nbp_strhash(&nbp_req->nve.object);
586 nbp_req->nve.type.len = type->len;
587 nbp_req->nve.type_hash = 0;
591 nbp_req->flags |= NBP_WILD_TYPE;
614 nbp_req->nve.type.str[i] = type->str[i];
617 nbp_req->nve.type_hash =
618 nbp_strhash(&nbp_req->nve.type);
623 strlcpy(zone,nbp_req.nve.zone.str, sizeof(zone));
624 strlcpy(object,nbp_req.nve.object.str, sizeof(object));
625 strlcpy(type,nbp_req.nve.type.str, sizeof(type));
688 static nve_entry_t *nbp_search_nve (nbp_req, ifID)
689 register nbp_req_t *nbp_req;
697 strlcpy(zone,nbp_req.nve.zone.str, sizeof(zone));
698 strlcpy(object,nbp_req.nve.object.str, sizeof(object));
699 strlcpy(type,nbp_req.nve.type.str, sizeof(type));
702 (u_int) nbp_req->response));
706 if ((nbp_req->nve.zone_hash) &&
707 ((nbp_req->nve.zone_hash !=
709 (nbp_req->nve.zone_hash != hzonehash)
714 nbp_req->nve.zone_hash));
722 at_nvestr_t *rzone=&nbp_req->nve.zone;
747 if (!(nbp_req->flags & NBP_WILD_OBJECT)) {
748 if ((nbp_req->nve.object_hash) &&
749 (nbp_req->nve.object_hash !=
753 if (nbp_strcmp (&nbp_req->nve.object,
761 if (!(nbp_req->flags & NBP_WILD_TYPE)) {
762 if ((nbp_req->nve.type_hash) &&
763 (nbp_req->nve.type_hash !=nve_entry->type_hash))
766 if (nbp_strcmp (&nbp_req->nve.type,
778 strlcpy(zone,nbp_req.nve.zone.str, sizeof(zone));
779 strlcpy(object,nbp_req.nve.object.str, sizeof(object));
780 strlcpy(type,nbp_req.nve.type.str, sizeof(type));
786 if (nbp_req->func != NULL) {
787 if ((*(nbp_req->func))(nbp_req, nve_entry) != 0) {
799 static int nbp_lkup_reply (nbp_req, nve_entry)
800 register nbp_req_t *nbp_req;
814 buf_len = ((nbp_req->flags & NBP_WILD_MASK) ? DDP_DATA_SIZE:tuple_size);
815 if (nbp_req->response == NULL) {
816 if (nbp_setup_resp (nbp_req, buf_len) != 0)
821 if ((nbp_req->space_unused < tuple_size) ||
822 (DATA_NBP(nbp_req->response)->tuple_count == NBP_TUPLE_MAX)) {
823 if (nbp_send_resp (nbp_req) != 0)
825 if (nbp_setup_resp (nbp_req, buf_len) != 0)
832 tuple = (at_nbptuple_t *)gbuf_wptr(nbp_req->response);
849 nbp_req->space_unused -= tuple_size;
850 gbuf_winc(nbp_req->response, tuple_size);
853 DATA_NBP(nbp_req->response)->tuple_count++;
939 static void nbp_setup_hdr (nbp_req)
940 register nbp_req_t *nbp_req;
945 ddp = DATA_DDP(nbp_req->response);
946 nbp = DATA_NBP(nbp_req->response);
952 switch(DATA_NBP(nbp_req->request)->control) {
954 ddp->dst_socket = nbp_req->nve.address.socket;
955 ddp->dst_node = nbp_req->nve.address.node;
956 NET_ASSIGN_NOSWAP(ddp->dst_net, nbp_req->nve.address.net);
960 nbp->at_nbp_id = DATA_NBP(nbp_req->request)->at_nbp_id;
965 static int nbp_setup_resp (nbp_req, tuples_size)
966 register nbp_req_t *nbp_req;
970 nbp_req->response = gbuf_alloc(AT_WR_OFFSET+buf_size, PRI_MED);
971 if (nbp_req->response == NULL) {
975 gbuf_rinc(nbp_req->response, AT_WR_OFFSET);
976 gbuf_wset(nbp_req->response, DDP_X_HDR_SIZE + NBP_HDR_SIZE);
977 nbp_setup_hdr(nbp_req);
979 DATA_NBP(nbp_req->response)->tuple_count = 0;
980 nbp_req->space_unused = tuples_size;
986 static int nbp_send_resp (nbp_req)
987 register nbp_req_t *nbp_req;
991 status = ddp_output(&nbp_req->response, (at_socket)NBP_SOCKET, FALSE);
992 nbp_req->response = NULL;
1410 strlcpy(zone,nbp_req.nve.zone.str, sizeof(zone));
1411 strlcpy(object,nbp_req.nve.object.str, sizeof(object));
1412 strlcpy(type,nbp_req.nve.type.str, sizeof(type));