Net-CDP
view release on metacpan or search on metacpan
Zero(MY_CXT.errors, CDP_ERRBUF_SIZE, char);
}
void
_ports()
PROTOTYPE:
PREINIT:
dMY_CXT;
UV count;
cdp_llist_t *ports;
PPCODE:
MY_CXT.errors[0] = '\0';
if (GIMME_V == G_VOID) XSRETURN_EMPTY;
ports = cdp_get_ports(MY_CXT.errors);
if (!ports) croak(MY_CXT.errors);
PUSH_port_llist(ports);
cdp_llist_free(ports);
Net_CDP
_new(CLASS, device, flags)
SV *CLASS
RETVAL = cdp_get_port(self);
OUTPUT:
RETVAL
void
addresses(self)
Net_CDP self
PROTOTYPE: $
PREINIT:
const cdp_llist_t *addresses;
PPCODE:
addresses = cdp_get_addresses(self);
PUSH_llist(addresses, "Net::CDP::Address");
int
_fd(self)
Net_CDP self
PROTOTYPE: $
CODE:
RETVAL = cdp_get_fd(self);
OUTPUT:
}
RETVAL = self->device_id;
OUTPUT:
RETVAL
void
addresses(self, new_addresses=NULL)
Net_CDP_Packet self
Net_CDP_Address_List new_addresses
PROTOTYPE: $;$
PPCODE:
if (items > 1) {
if (self->addresses) cdp_llist_free(self->addresses);
self->addresses = new_addresses;
}
PUSH_llist(self->addresses, "Net::CDP::Address");
PV_UNDEF
port(self, new_port=NULL)
Net_CDP_Packet self
PV_UNDEF new_port
}
RETVAL = self->platform;
OUTPUT:
RETVAL
void
ip_prefixes(self, new_ip_prefixes=NULL)
Net_CDP_Packet self
Net_CDP_IPPrefix_List new_ip_prefixes
PROTOTYPE: $;$
PPCODE:
if (items > 1) {
if (self->ip_prefixes) cdp_llist_free(self->ip_prefixes);
self->ip_prefixes = new_ip_prefixes;
}
PUSH_llist(self->ip_prefixes, "Net::CDP::IPPrefix");
PV_UNDEF
vtp_management_domain(self, new_vtp_management_domain=NULL)
Net_CDP_Packet self
PV_UNDEF new_vtp_management_domain
RETVAL = self->duplex;
OUTPUT:
RETVAL
void
voice_vlan(self, new_voice_vlan=NULL, new_appliance_id=NULL)
Net_CDP_Packet self
U16_UNDEF new_voice_vlan
U8_UNDEF new_appliance_id
PROTOTYPE: $;$$
PPCODE:
if (items > 1) {
if (new_voice_vlan && (*new_voice_vlan < 1 || *new_voice_vlan > MAX_VLAN_ID))
croak("Invalid new_voice_vlan (must be between 1 and %u)", MAX_VLAN_ID);
if (new_appliance_id && *new_appliance_id < 1)
croak("Invalid new_appliance_id (must be between 1 and 255)");
if (new_voice_vlan) {
if (self->appliance)
self->appliance->vlan = *new_voice_vlan;
else
self->appliance = cdp_appliance_new(
CHECK_VERSION;
}
PUSH_appliance(self->appliance);
void
voice_vlan_query(self, new_voice_vlan=NULL, new_appliance_id=NULL)
Net_CDP_Packet self
U16_UNDEF new_voice_vlan
U8_UNDEF new_appliance_id
PROTOTYPE: $;$$
PPCODE:
if (items > 1) {
if (new_voice_vlan && (*new_voice_vlan < 1 || *new_voice_vlan > MAX_VLAN_ID))
croak("Invalid new_voice_vlan (must be between 1 and %u)", MAX_VLAN_ID);
if (new_appliance_id && *new_appliance_id < 1)
croak("Invalid new_appliance_id (must be between 1 and 255)");
if (new_voice_vlan) {
if (self->appliance_query)
self->appliance_query->vlan = *new_voice_vlan;
else
self->appliance_query = cdp_appliance_new(
}
RETVAL = self->untrusted_cos;
OUTPUT:
RETVAL
void
management_addresses(self, new_addresses=NULL)
Net_CDP_Packet self
Net_CDP_Address_List new_addresses
PROTOTYPE: $;$
PPCODE:
if (items > 1) {
if (self->mgmt_addresses) cdp_llist_free(self->mgmt_addresses);
self->mgmt_addresses = new_addresses;
CHECK_VERSION;
}
PUSH_llist(self->mgmt_addresses, "Net::CDP::Address");
MODULE = Net::CDP PACKAGE = Net::CDP::Address
Net_CDP_Address
fallback/const-xs.inc view on Meta::CPAN
dTARGET;
#endif
STRLEN len;
int type;
IV iv;
/* NV nv; Uncomment this if you need to return NVs */
/* const char *pv; Uncomment this if you need to return PVs */
INPUT:
SV * sv;
const char * s = SvPV(sv, len);
PPCODE:
/* Change this to constant(aTHX_ s, len, &iv, &nv);
if you need to return both NVs and IVs */
type = constant(aTHX_ s, len, &iv);
/* Return 1 or 2 items. First is error message, or undef if no error.
Second, if present, is found value */
switch (type) {
case PERL_constant_NOTFOUND:
sv = sv_2mortal(newSVpvf("%s is not a valid Net::CDP::Constants macro", s));
PUSHs(sv);
break;
( run in 1.434 second using v1.01-cache-2.11-cpan-5511b514fd6 )