• Home
  • Raw
  • Download

Lines Matching refs:mrb

44 mrb_value env_init(mrb_state *mrb, mrb_value self) { return self; }  in env_init()  argument
48 mrb_value env_get_req(mrb_state *mrb, mrb_value self) { in env_get_req() argument
49 return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "req")); in env_get_req()
54 mrb_value env_get_resp(mrb_state *mrb, mrb_value self) { in env_get_resp() argument
55 return mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "resp")); in env_get_resp()
60 mrb_value env_get_ctx(mrb_state *mrb, mrb_value self) { in env_get_ctx() argument
61 auto data = reinterpret_cast<MRubyAssocData *>(mrb->ud); in env_get_ctx()
64 auto dsym = intern_ptr(mrb, downstream); in env_get_ctx()
66 auto ctx = mrb_iv_get(mrb, self, dsym); in env_get_ctx()
68 ctx = mrb_hash_new(mrb); in env_get_ctx()
69 mrb_iv_set(mrb, self, dsym, ctx); in env_get_ctx()
77 mrb_value env_get_phase(mrb_state *mrb, mrb_value self) { in env_get_phase() argument
78 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_phase()
85 mrb_value env_get_remote_addr(mrb_state *mrb, mrb_value self) { in env_get_remote_addr() argument
86 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_remote_addr()
93 return mrb_str_new(mrb, ipaddr.c_str(), ipaddr.size()); in env_get_remote_addr()
98 mrb_value env_get_server_port(mrb_state *mrb, mrb_value self) { in env_get_server_port() argument
99 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_server_port()
110 mrb_value env_get_server_addr(mrb_state *mrb, mrb_value self) { in env_get_server_addr() argument
111 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_server_addr()
117 return mrb_str_new(mrb, faddr->host.c_str(), faddr->host.size()); in env_get_server_addr()
122 mrb_value env_get_tls_used(mrb_state *mrb, mrb_value self) { in env_get_tls_used() argument
123 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_used()
133 mrb_value env_get_tls_sni(mrb_state *mrb, mrb_value self) { in env_get_tls_sni() argument
134 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_sni()
140 return mrb_str_new(mrb, sni.c_str(), sni.size()); in env_get_tls_sni()
145 mrb_value env_get_tls_client_fingerprint_md(mrb_state *mrb, const EVP_MD *md) { in env_get_tls_client_fingerprint_md() argument
146 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_client_fingerprint_md()
153 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_fingerprint_md()
162 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_fingerprint_md()
172 mrb_raise(mrb, E_RUNTIME_ERROR, "could not compute client fingerprint"); in env_get_tls_client_fingerprint_md()
179 return mrb_str_new(mrb, f.c_str(), f.size()); in env_get_tls_client_fingerprint_md()
184 mrb_value env_get_tls_client_fingerprint_sha256(mrb_state *mrb, in env_get_tls_client_fingerprint_sha256() argument
186 return env_get_tls_client_fingerprint_md(mrb, EVP_sha256()); in env_get_tls_client_fingerprint_sha256()
191 mrb_value env_get_tls_client_fingerprint_sha1(mrb_state *mrb, mrb_value self) { in env_get_tls_client_fingerprint_sha1() argument
192 return env_get_tls_client_fingerprint_md(mrb, EVP_sha1()); in env_get_tls_client_fingerprint_sha1()
197 mrb_value env_get_tls_client_subject_name(mrb_state *mrb, mrb_value self) { in env_get_tls_client_subject_name() argument
198 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_client_subject_name()
205 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_subject_name()
214 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_subject_name()
222 return mrb_str_new(mrb, name.c_str(), name.size()); in env_get_tls_client_subject_name()
227 mrb_value env_get_tls_client_issuer_name(mrb_state *mrb, mrb_value self) { in env_get_tls_client_issuer_name() argument
228 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_client_issuer_name()
235 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_issuer_name()
244 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_issuer_name()
252 return mrb_str_new(mrb, name.c_str(), name.size()); in env_get_tls_client_issuer_name()
257 mrb_value env_get_tls_client_serial(mrb_state *mrb, mrb_value self) { in env_get_tls_client_serial() argument
258 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_client_serial()
265 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_serial()
274 return mrb_str_new_static(mrb, "", 0); in env_get_tls_client_serial()
282 return mrb_str_new(mrb, sn.c_str(), sn.size()); in env_get_tls_client_serial()
287 mrb_value env_get_tls_client_not_before(mrb_state *mrb, mrb_value self) { in env_get_tls_client_not_before() argument
288 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_client_not_before()
321 mrb_value env_get_tls_client_not_after(mrb_state *mrb, mrb_value self) { in env_get_tls_client_not_after() argument
322 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_client_not_after()
355 mrb_value env_get_tls_cipher(mrb_state *mrb, mrb_value self) { in env_get_tls_cipher() argument
356 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_cipher()
363 return mrb_str_new_static(mrb, "", 0); in env_get_tls_cipher()
366 return mrb_str_new_cstr(mrb, SSL_get_cipher_name(ssl)); in env_get_tls_cipher()
371 mrb_value env_get_tls_protocol(mrb_state *mrb, mrb_value self) { in env_get_tls_protocol() argument
372 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_protocol()
379 return mrb_str_new_static(mrb, "", 0); in env_get_tls_protocol()
382 return mrb_str_new_cstr(mrb, nghttp2::tls::get_tls_protocol(ssl)); in env_get_tls_protocol()
387 mrb_value env_get_tls_session_id(mrb_state *mrb, mrb_value self) { in env_get_tls_session_id() argument
388 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_session_id()
395 return mrb_str_new_static(mrb, "", 0); in env_get_tls_session_id()
400 return mrb_str_new_static(mrb, "", 0); in env_get_tls_session_id()
409 return mrb_str_new(mrb, id.c_str(), id.size()); in env_get_tls_session_id()
414 mrb_value env_get_tls_session_reused(mrb_state *mrb, mrb_value self) { in env_get_tls_session_reused() argument
415 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_session_reused()
430 mrb_value env_get_alpn(mrb_state *mrb, mrb_value self) { in env_get_alpn() argument
431 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_alpn()
436 return mrb_str_new(mrb, alpn.c_str(), alpn.size()); in env_get_alpn()
441 mrb_value env_get_tls_handshake_finished(mrb_state *mrb, mrb_value self) { in env_get_tls_handshake_finished() argument
442 auto data = static_cast<MRubyAssocData *>(mrb->ud); in env_get_tls_handshake_finished()
452 void init_env_class(mrb_state *mrb, RClass *module) { in init_env_class() argument
454 mrb_define_class_under(mrb, module, "Env", mrb->object_class); in init_env_class()
456 mrb_define_method(mrb, env_class, "initialize", env_init, MRB_ARGS_NONE()); in init_env_class()
457 mrb_define_method(mrb, env_class, "req", env_get_req, MRB_ARGS_NONE()); in init_env_class()
458 mrb_define_method(mrb, env_class, "resp", env_get_resp, MRB_ARGS_NONE()); in init_env_class()
459 mrb_define_method(mrb, env_class, "ctx", env_get_ctx, MRB_ARGS_NONE()); in init_env_class()
460 mrb_define_method(mrb, env_class, "phase", env_get_phase, MRB_ARGS_NONE()); in init_env_class()
461 mrb_define_method(mrb, env_class, "remote_addr", env_get_remote_addr, in init_env_class()
463 mrb_define_method(mrb, env_class, "server_addr", env_get_server_addr, in init_env_class()
465 mrb_define_method(mrb, env_class, "server_port", env_get_server_port, in init_env_class()
467 mrb_define_method(mrb, env_class, "tls_used", env_get_tls_used, in init_env_class()
469 mrb_define_method(mrb, env_class, "tls_sni", env_get_tls_sni, in init_env_class()
471 mrb_define_method(mrb, env_class, "tls_client_fingerprint_sha256", in init_env_class()
473 mrb_define_method(mrb, env_class, "tls_client_fingerprint_sha1", in init_env_class()
475 mrb_define_method(mrb, env_class, "tls_client_issuer_name", in init_env_class()
477 mrb_define_method(mrb, env_class, "tls_client_subject_name", in init_env_class()
479 mrb_define_method(mrb, env_class, "tls_client_serial", in init_env_class()
481 mrb_define_method(mrb, env_class, "tls_client_not_before", in init_env_class()
483 mrb_define_method(mrb, env_class, "tls_client_not_after", in init_env_class()
485 mrb_define_method(mrb, env_class, "tls_cipher", env_get_tls_cipher, in init_env_class()
487 mrb_define_method(mrb, env_class, "tls_protocol", env_get_tls_protocol, in init_env_class()
489 mrb_define_method(mrb, env_class, "tls_session_id", env_get_tls_session_id, in init_env_class()
491 mrb_define_method(mrb, env_class, "tls_session_reused", in init_env_class()
493 mrb_define_method(mrb, env_class, "alpn", env_get_alpn, MRB_ARGS_NONE()); in init_env_class()
494 mrb_define_method(mrb, env_class, "tls_handshake_finished", in init_env_class()