Lines Matching refs:p
105 int ceph_auth_entity_name_encode(const char *name, void **p, void *end) in ceph_auth_entity_name_encode() argument
109 if (*p + 2*sizeof(u32) + len > end) in ceph_auth_entity_name_encode()
111 ceph_encode_32(p, CEPH_ENTITY_TYPE_CLIENT); in ceph_auth_entity_name_encode()
112 ceph_encode_32(p, len); in ceph_auth_entity_name_encode()
113 ceph_encode_copy(p, name, len); in ceph_auth_entity_name_encode()
124 void *p = monhdr + 1, *end = buf + len, *lenp; in ceph_auth_build_hello() local
134 ceph_encode_32(&p, CEPH_AUTH_UNKNOWN); /* no protocol, yet */ in ceph_auth_build_hello()
136 lenp = p; in ceph_auth_build_hello()
137 p += sizeof(u32); in ceph_auth_build_hello()
139 ceph_decode_need(&p, end, 1 + sizeof(u32), bad); in ceph_auth_build_hello()
140 ceph_encode_8(&p, 1); in ceph_auth_build_hello()
142 ceph_encode_32(&p, num); in ceph_auth_build_hello()
143 ceph_decode_need(&p, end, num * sizeof(u32), bad); in ceph_auth_build_hello()
145 ceph_encode_32(&p, supported_protocols[i]); in ceph_auth_build_hello()
147 ret = ceph_auth_entity_name_encode(ac->name, &p, end); in ceph_auth_build_hello()
150 ceph_decode_need(&p, end, sizeof(u64), bad); in ceph_auth_build_hello()
151 ceph_encode_64(&p, ac->global_id); in ceph_auth_build_hello()
153 ceph_encode_32(&lenp, p - lenp - sizeof(u32)); in ceph_auth_build_hello()
154 ret = p - buf; in ceph_auth_build_hello()
168 void *p; in build_request() local
171 p = buf; in build_request()
174 ceph_encode_64_safe(&p, end, 0, e_range); in build_request()
175 ceph_encode_16_safe(&p, end, -1, e_range); in build_request()
176 ceph_encode_64_safe(&p, end, 0, e_range); in build_request()
177 ceph_encode_32_safe(&p, end, ac->protocol, e_range); in build_request()
180 ceph_encode_need(&p, end, sizeof(u32), e_range); in build_request()
181 ret = ac->ops->build_request(ac, p + sizeof(u32), end); in build_request()
188 ceph_encode_32(&p, ret); in build_request()
189 return p + ret - buf; in build_request()
202 void *p = buf; in ceph_handle_auth_reply() local
214 dout("handle_auth_reply %p %p\n", p, end); in ceph_handle_auth_reply()
215 ceph_decode_need(&p, end, sizeof(u32) * 3 + sizeof(u64), bad); in ceph_handle_auth_reply()
216 protocol = ceph_decode_32(&p); in ceph_handle_auth_reply()
217 result = ceph_decode_32(&p); in ceph_handle_auth_reply()
218 global_id = ceph_decode_64(&p); in ceph_handle_auth_reply()
219 payload_len = ceph_decode_32(&p); in ceph_handle_auth_reply()
220 payload = p; in ceph_handle_auth_reply()
221 p += payload_len; in ceph_handle_auth_reply()
222 ceph_decode_need(&p, end, sizeof(u32), bad); in ceph_handle_auth_reply()
223 result_msg_len = ceph_decode_32(&p); in ceph_handle_auth_reply()
224 result_msg = p; in ceph_handle_auth_reply()
225 p += result_msg_len; in ceph_handle_auth_reply()
226 if (p != end) in ceph_handle_auth_reply()
406 static int encode_con_modes(void **p, void *end, int pref_mode, int fallb_mode) in encode_con_modes() argument
410 ceph_encode_32_safe(p, end, 2, e_range); in encode_con_modes()
411 ceph_encode_32_safe(p, end, pref_mode, e_range); in encode_con_modes()
412 ceph_encode_32_safe(p, end, fallb_mode, e_range); in encode_con_modes()
414 ceph_encode_32_safe(p, end, 1, e_range); in encode_con_modes()
415 ceph_encode_32_safe(p, end, pref_mode, e_range); in encode_con_modes()
432 void *p; in ceph_auth_get_request() local
448 p = buf; in ceph_auth_get_request()
449 ceph_encode_32_safe(&p, end, ac->protocol, e_range); in ceph_auth_get_request()
450 ret = encode_con_modes(&p, end, ac->preferred_mode, ac->fallback_mode); in ceph_auth_get_request()
454 lenp = p; in ceph_auth_get_request()
455 p += 4; /* space for len */ in ceph_auth_get_request()
457 ceph_encode_8_safe(&p, end, CEPH_AUTH_MODE_MON, e_range); in ceph_auth_get_request()
458 ret = ceph_auth_entity_name_encode(ac->name, &p, end); in ceph_auth_get_request()
462 ceph_encode_64_safe(&p, end, ac->global_id, e_range); in ceph_auth_get_request()
463 ceph_encode_32(&lenp, p - lenp - 4); in ceph_auth_get_request()
464 ret = p - buf; in ceph_auth_get_request()
554 void *p; in ceph_auth_get_authorizer() local
562 p = buf; in ceph_auth_get_authorizer()
563 ceph_encode_32_safe(&p, end, proto, e_range); in ceph_auth_get_authorizer()
564 ret = encode_con_modes(&p, end, pref_mode, fallb_mode); in ceph_auth_get_authorizer()
568 ceph_encode_32_safe(&p, end, auth->authorizer_buf_len, e_range); in ceph_auth_get_authorizer()
569 *buf_len = p - buf; in ceph_auth_get_authorizer()
583 void *p; in ceph_auth_handle_svc_reply_more() local
591 p = buf; in ceph_auth_handle_svc_reply_more()
592 ceph_encode_32_safe(&p, end, auth->authorizer_buf_len, e_range); in ceph_auth_handle_svc_reply_more()
593 *buf_len = p - buf; in ceph_auth_handle_svc_reply_more()