Lines Matching refs:dsp
81 static void ds_free_dslibentry(dslibentry_t *dsp, int force_unreg);
83 static void ds_string_arg(vlds_string_t *dsp, char *str);
90 dslibentry_t *dsp; in ds_hdl_to_dslibentry() local
92 for (i = 0, dsp = dslibtab; i < ndslib; i++, dsp++) { in ds_hdl_to_dslibentry()
93 if (hdl == dsp->dsl_hdl) in ds_hdl_to_dslibentry()
94 return (dsp); in ds_hdl_to_dslibentry()
103 dslibentry_t *dsp; in ds_new_dslibentry() local
105 if ((dsp = ds_hdl_to_dslibentry(NULL)) != NULL) in ds_new_dslibentry()
106 return (dsp); in ds_new_dslibentry()
113 dsp = &dslibtab[ndslib]; in ds_new_dslibentry()
114 (void) memset(dsp, 0, (newndslib - ndslib) * sizeof (dslibentry_t)); in ds_new_dslibentry()
116 return (dsp); in ds_new_dslibentry()
123 dslibentry_t *dsp; in ds_service_count() local
127 for (i = 0, dsp = dslibtab; i < ndslib; i++, dsp++) { in ds_service_count()
128 if (dsp->dsl_hdl != NULL && in ds_service_count()
129 strcmp(dsp->dsl_service, service) == 0 && in ds_service_count()
130 (dsp->dsl_flags & VLDS_REG_CLIENT) == is_client_flag) { in ds_service_count()
141 dslibentry_t *dsp; in ds_lookup_dslibentry() local
144 for (i = 0, dsp = dslibtab; i < ndslib; i++, dsp++) { in ds_lookup_dslibentry()
145 if (dsp->dsl_hdl != NULL && in ds_lookup_dslibentry()
146 strcmp(dsp->dsl_service, service) == 0 && in ds_lookup_dslibentry()
147 (dsp->dsl_flags & VLDS_REG_CLIENT) == is_client_flag) { in ds_lookup_dslibentry()
148 return (dsp); in ds_lookup_dslibentry()
157 dslibentry_t *dsp, *orig_dsp; in ds_register_dslibentry() local
159 if ((dsp = ds_hdl_to_dslibentry(hdl)) != NULL) { in ds_register_dslibentry()
160 dsp->dsl_tflags |= DSL_ENTRY_INUSE; in ds_register_dslibentry()
161 return (dsp); in ds_register_dslibentry()
176 if ((dsp = ds_new_dslibentry()) == NULL) in ds_register_dslibentry()
179 *dsp = *orig_dsp; in ds_register_dslibentry()
180 dsp->dsl_service = strdup(orig_dsp->dsl_service); in ds_register_dslibentry()
181 dsp->dsl_hdl = hdl; in ds_register_dslibentry()
182 return (dsp); in ds_register_dslibentry()
190 ds_free_dslibentry(dslibentry_t *dsp, int force_unreg) in ds_free_dslibentry() argument
200 nhdls = ds_service_count(dsp->dsl_service, in ds_free_dslibentry()
201 (dsp->dsl_flags & VLDS_REG_CLIENT) != 0); in ds_free_dslibentry()
204 dsp->dsl_hdl = NULL; in ds_free_dslibentry()
205 if (dsp->dsl_service) { in ds_free_dslibentry()
206 free(dsp->dsl_service); in ds_free_dslibentry()
208 (void) memset(dsp, 0, sizeof (dslibentry_t)); in ds_free_dslibentry()
210 dsp->dsl_tflags &= ~DSL_ENTRY_INUSE; in ds_free_dslibentry()
227 dslibentry_t *dsp; in ds_recv() local
245 if ((dsp = ds_register_dslibentry(hdl, in ds_recv()
247 reg_cb = dsp->dsl_ops.ds_reg_cb; in ds_recv()
248 cb_arg = dsp->dsl_ops.cb_arg; in ds_recv()
266 if ((dsp = ds_hdl_to_dslibentry(hdl)) != NULL) { in ds_recv()
267 unreg_cb = dsp->dsl_ops.ds_unreg_cb; in ds_recv()
268 cb_arg = dsp->dsl_ops.cb_arg; in ds_recv()
269 ds_free_dslibentry(dsp, 0); in ds_recv()
280 if ((dsp = ds_hdl_to_dslibentry(hdl)) != NULL) { in ds_recv()
281 data_cb = dsp->dsl_ops.ds_data_cb; in ds_recv()
282 cb_arg = dsp->dsl_ops.cb_arg; in ds_recv()
297 ds_string_arg(vlds_string_t *dsp, char *str) in ds_string_arg() argument
300 dsp->vlds_strp = NULL; in ds_string_arg()
301 dsp->vlds_strlen = 0; in ds_string_arg()
303 dsp->vlds_strp = PTRTOUINT64(str); in ds_string_arg()
304 dsp->vlds_strlen = strlen(str) + 1; in ds_string_arg()
350 dslibentry_t *dsp; in ds_register() local
378 if ((dsp = ds_new_dslibentry()) == NULL) { in ds_register()
434 dsp->dsl_hdl = hdl; in ds_register()
435 dsp->dsl_flags = flags; in ds_register()
436 dsp->dsl_tflags = 0; in ds_register()
437 dsp->dsl_service = strdup(cap->svc_id); in ds_register()
438 dsp->dsl_ops = *ops; in ds_register()
535 dslibentry_t *dsp; in ds_unreg_hdl() local
539 if ((dsp = ds_hdl_to_dslibentry(hdl)) != NULL) { in ds_unreg_hdl()
540 ds_free_dslibentry(dsp, 1); in ds_unreg_hdl()
703 dslibentry_t *dsp; in ds_fini() local
716 for (i = 0, dsp = dslibtab; i < ndslib; i++, dsp++) { in ds_fini()
717 if (dsp->dsl_hdl == NULL) in ds_fini()
719 if (dsp->dsl_service) { in ds_fini()
720 free(dsp->dsl_service); in ds_fini()