msv/msv.h(3)

πŸ“¦
version 1.1.1 Β· 3 versions
, in debian bookworm, ubuntu jammy

✨ msv/msv.h β€” main public libmsv header file ✨

okay bestie, so this is the page for msv/msv.h(3), and it lives in the Library Functions Manual. it's the main public libmsv header file and honestly? it's giving backbone of the whole libmsv situation. let's get into it 🫢


🌸 NAME 🌸

msv/msv.h β€” main public libmsv header file


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <unistd.h>

πŸ’– Data Structures πŸ’–

  • struct msv_query β€” a query to the MSVA
  • struct msv_response β€” a response from the MSVA

πŸŽ€ Macros πŸŽ€

  • #define LIBMSV_ERROR_SUCCESS 0 β€” Success or absence of error.
  • #define LIBMSV_ERROR_INVALID 1 β€” Use of certificate could not be determined valid or was determined invalid.
  • #define LIBMSV_ERROR_NOENVVAR 2 β€” Environment variable was needed but was not set.
  • #define LIBMSV_ERROR_CURLINIT_FAILED 3 β€” curl_easy_init() failed for unknown reason
  • #define LIBMSV_ERROR_CURLCODE 4 β€” an unspecified curl function failed
  • #define LIBMSV_ERROR_INCOMPATIBLE_AGENT 5 β€” MSVA was perceived as incompatible.
  • #define LIBMSV_ERROR_BADARG 6 β€” An argument to the function was invalid.
  • #define LIBMSV_ERROR_UNEXPECTED_RESPONSE 7 β€” The response from MSVA was unexpected.
  • #define LIBMSV_ERROR_NOMEM 8 β€” necessary memory allocation failed
  • MSV_DEPRECATED(X) β€” X

🧚 Typedefs 🧚

  • typedef struct msv_ctxt * msv_ctxt_t β€” opaque MSVA context

πŸ’… Functions πŸ’…

  • msv_ctxt_t msv_ctxt_init (const char *url) β€” Return an MSV context.
  • void msv_ctxt_destroy (msv_ctxt_t ctx) β€” Destroy an MSV context.
  • const char * msv_strerror (msv_ctxt_t ctx, int error_code) β€” Return string describing libmsv error code.
  • int msv_check_msva (msv_ctxt_t ctx) β€” Check suitability of Monkeysphere Validation Agent.
  • int msv_query_agent (msv_ctxt_t ctx, struct msv_query q, struct msv_response **response_ptr) β€” Query validation agent for certificate validity.
  • void msv_response_destroy (struct msv_response *response) β€” Destroy an MSV response.

πŸ‘‘ Detailed Description πŸ‘‘

main public libmsv header file

like, that's it. that's the whole vibe. this header is the front door to libmsv, no cap. 🏠✨


πŸ”₯ Macro Definition Documentation πŸ”₯

🌈 #define LIBMSV_ERROR_CURLCODE 4

an unspecified curl function failed.

and listen β€” the MSV context retains the curl error code for the last operation run within that context. so if you're wondering "which curl thing broke, bestie?", the context remembers. iykyk. πŸ’€


⭐ Function Documentation ⭐

πŸ’œ int msv_check_msva (msv_ctxt_t ctx)

Check suitability of Monkeysphere Validation Agent.

Parameters:

  • ctx β€” the MSV context

Returns:

0 for success, or libmsv error code


πŸ’œ void msv_ctxt_destroy (msv_ctxt_t ctx)

Destroy an MSV context.

Parameters:

  • ctx β€” the MSV context to destroy

πŸ’œ msv_ctxt_t msv_ctxt_init (const char * url)

Return an MSV context.

Parameters:

  • url β€” URL for MSVA or NULL to use MONKEYSPHERE_VALIDATION_AGENT_SOCKET environment variable

Returns:

MSV context

pro tip from your girl: pass NULL and the MONKEYSPHERE_VALIDATION_AGENT_SOCKET env var takes over. the way that env var just carries the whole thing on its back 😭🫢

πŸ’œ int msv_query_agent (msv_ctxt_t ctx, struct msv_query q, struct msv_response ** response_ptr)

Query validation agent for certificate validity.

Parameters:

  • ctx β€” the MSV context
  • q β€” msv_query struct representing the MSVA query
  • response_ptr β€” pointer to pointer to msv_response struct that the caller is responsible for destroying via msv_response_destroy

Returns:

0 for valid use of certificate, 1 for invalid use of certificate, or libmsv error code

🚨 okay important one: you, the caller, are responsible for destroying that msv_response struct via msv_response_destroy. don't leave it hanging, bestie, that's not main character energy, that's a memory leak energy. πŸ’…

πŸ’œ void msv_response_destroy (struct msv_response * response)

Destroy an MSV response.

Parameters:

  • response β€” the MSV response to destroy

πŸ’œ const char * msv_strerror (msv_ctxt_t ctx, int error_code)

Return string describing libmsv error code.

Parameters:

  • ctx β€” the relevant MSV context
  • error_code β€” return value of libmsv function

Returns:

string describing error


πŸŽ€ Author πŸŽ€

Generated automatically by Doxygen for libmsv from the source code.


and that's the whole page, bestie!! 🌟 this was libmsv, dated Wed Feb 27 2019 β€” yeah she's an elder but she still ate. periodt. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from