⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syntax-inetaddress-get.m2i

📁 开发snmp的开发包有两个开放的SNMP开发库
💻 M2I
字号:
#############################################################  -*- c -*-## generic include for XXX. Do not use directly.#### $Id: syntax-InetAddress-get.m2i 11795 2005-01-06 14:49:39Z rstory $########################################################################@if $m2c_mark_boundary == 1@/** START code generated by $RCSfile$ $Revision: 11795 $ */@end@##########################################################################    /*     * TODO:231:M: |-> copy $node data.     * TODO:231:M: |   |-> get address type from your context pointer.     */    int  addressType = -1;    size_t actual_size = 0;    return MFD_SKIP; /* TODO:235:M: |-> Remove SKIP once you've set $node data */    switch (addressType) {    case INETADDRESSTYPE_UNKNOWN:    /*     * An unknown address type. This value MUST  be used if the value     * of the InetAddress object is a zero-length string. It may also be     * used to indicate an IP address which is not in one of the formats     * defined below.     */        actual_size = ${m2c_ctx_rhs};        break;    case INETADDRESSTYPE_IPV4:    /*     * Represents an IPv4 network address:     *      octets   contents         encoding     *       1-4     IPv4 address     network-byte order     */        actual_size = 4;        break;    case INETADDRESSTYPE_IPV6:    /*     * Represents an IPv6 network address:     *     *      octets   contents         encoding     *       1-16    IPv6 address     network-byte order     */        actual_size = 16;        break;    case INETADDRESSTYPE_IPV4Z:    /*     * Represents a non-global IPv4 network address together     *    with its zone index:     *     *      octets   contents         encoding     *       1-4     IPv4 address     network-byte order     *       5-8     zone index       network-byte order     */        actual_size = 8;        break;    case INETADDRESSTYPE_IPV6Z:    /*     * Represents a non-global IPv6 network address together     *    with its zone index:     *     *      octets   contents         encoding     *       1-16    IPv6 address     network-byte order     *      17-20    zone index       network-byte order     */        actual_size = 20;        break;    case INETADDRESSTYPE_DNS:    /*     * Represents a DNS domain name. The name SHOULD be fully     *    qualified whenever possible.     */        actual_size = ${m2c_ctx_rhs};        break;    default:        snmp_log(LOG_ERR, "unknown InetAddressType %d for $node\n",                 addressType);        return SNMP_ERR_GENERR;    }    if ( actual_size > ${m2c_ctx_lhs} ) {        snmp_log(LOG_ERR, "actual size %d too big for $node\n",                 addressType);        return SNMP_ERR_GENERR;    }    memcpy( ${m2c_ctx_lh}, ${m2c_ctx_rh}, actual_size);    ${m2c_ctx_lhs} = actual_size;##########################################################################@if $m2c_mark_boundary == 1@/** END code generated by $RCSfile$ $Revision: 11795 $ */@end@

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -