/* * This file was generated automatically by ExtUtils::ParseXS version 2.18 from the * contents of TacacsPlus.xs. Do not edit this file, edit TacacsPlus.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "TacacsPlus.xs" #ifdef __cplusplus extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #ifdef __cplusplus } #endif #include #include "tacpluslib/tacplus_client.h" #include "tacpluslib/tac_plus.h" static int not_here(s) char *s; { croak("%s not implemented on this architecture", s); return -1; } static double constant(name, arg) char *name; int arg; { errno = 0; switch (*name) { case 'A': break; case 'B': break; case 'C': break; case 'D': break; case 'E': break; case 'F': break; case 'G': break; case 'H': break; case 'I': break; case 'J': break; case 'K': break; case 'L': break; case 'M': break; case 'N': break; case 'O': break; case 'P': break; case 'Q': break; case 'R': break; case 'S': break; case 'T': if (strEQ(name, "TACPLUS_CLIENT")) #ifdef TACPLUS_CLIENT return TACPLUS_CLIENT; #else goto not_there; #endif else if (strEQ(name, "TAC_PLUS_AUTHEN_TYPE_ASCII")) return TAC_PLUS_AUTHEN_TYPE_ASCII; else if (strEQ(name, "TAC_PLUS_AUTHEN_TYPE_PAP")) return TAC_PLUS_AUTHEN_TYPE_PAP; else if (strEQ(name, "TAC_PLUS_AUTHEN_TYPE_CHAP")) return TAC_PLUS_AUTHEN_TYPE_CHAP; else if (strEQ(name, "TAC_PLUS_AUTHEN_TYPE_ARAP")) return TAC_PLUS_AUTHEN_TYPE_ARAP; break; case 'U': break; case 'V': break; case 'W': break; case 'X': break; case 'Y': break; case 'Z': break; } errno = EINVAL; return 0; not_there: errno = ENOENT; return 0; } #ifndef PERL_UNUSED_VAR # define PERL_UNUSED_VAR(var) if (0) var = var #endif #line 120 "TacacsPlus.c" XS(XS_Authen__TacacsPlus_constant); /* prototype to pass -Wmissing-prototypes */ XS(XS_Authen__TacacsPlus_constant) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Authen::TacacsPlus::constant", "name, arg"); PERL_UNUSED_VAR(cv); /* -W */ { char * name = (char *)SvPV_nolen(ST(0)); int arg = (int)SvIV(ST(1)); double RETVAL; dXSTARG; RETVAL = constant(name, arg); XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_Authen__TacacsPlus_init_tac_session); /* prototype to pass -Wmissing-prototypes */ XS(XS_Authen__TacacsPlus_init_tac_session) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 4) Perl_croak(aTHX_ "Usage: %s(%s)", "Authen::TacacsPlus::init_tac_session", "host_name, port_name, key, timeout"); PERL_UNUSED_VAR(cv); /* -W */ { char* host_name = (char *)SvPV_nolen(ST(0)); char* port_name = (char *)SvPV_nolen(ST(1)); char* key = (char *)SvPV_nolen(ST(2)); int timeout = (int)SvIV(ST(3)); int RETVAL; dXSTARG; RETVAL = init_tac_session(host_name, port_name, key, timeout); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Authen__TacacsPlus_make_auth); /* prototype to pass -Wmissing-prototypes */ XS(XS_Authen__TacacsPlus_make_auth) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Authen::TacacsPlus::make_auth", "username, password, authen_type"); PERL_UNUSED_VAR(cv); /* -W */ { char* username = (char *)SvPV_nolen(ST(0)); char* password = (char *)SvPV_nolen(ST(1)); int authen_type = (int)SvIV(ST(2)); int RETVAL; dXSTARG; #line 130 "TacacsPlus.xs" int user_len; int password_len; username = (char *)SvPV(ST(0),user_len); password = (char *)SvPV(ST(1),password_len); RETVAL = make_auth(username, user_len, password, password_len, authen_type); #line 197 "TacacsPlus.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Authen__TacacsPlus_deinit_tac_session); /* prototype to pass -Wmissing-prototypes */ XS(XS_Authen__TacacsPlus_deinit_tac_session) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "Authen::TacacsPlus::deinit_tac_session", ""); PERL_UNUSED_VAR(cv); /* -W */ { deinit_tac_session(); } XSRETURN_EMPTY; } XS(XS_Authen__TacacsPlus_errmsg); /* prototype to pass -Wmissing-prototypes */ XS(XS_Authen__TacacsPlus_errmsg) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "Authen::TacacsPlus::errmsg", ""); PERL_UNUSED_VAR(cv); /* -W */ { SV * RETVAL; #line 147 "TacacsPlus.xs" { ST(0) = sv_2mortal(newSVpv(tac_err,strlen(tac_err))); } #line 241 "TacacsPlus.c" } XSRETURN(1); } #ifdef __cplusplus extern "C" #endif XS(boot_Authen__TacacsPlus); /* prototype to pass -Wmissing-prototypes */ XS(boot_Authen__TacacsPlus) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif char* file = __FILE__; PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ XS_VERSION_BOOTCHECK ; newXS("Authen::TacacsPlus::constant", XS_Authen__TacacsPlus_constant, file); newXS("Authen::TacacsPlus::init_tac_session", XS_Authen__TacacsPlus_init_tac_session, file); newXS("Authen::TacacsPlus::make_auth", XS_Authen__TacacsPlus_make_auth, file); newXS("Authen::TacacsPlus::deinit_tac_session", XS_Authen__TacacsPlus_deinit_tac_session, file); newXS("Authen::TacacsPlus::errmsg", XS_Authen__TacacsPlus_errmsg, file); XSRETURN_YES; }