Beispiel #1
0
        internal memp memp_malloc(memp_t type)
        {
            memp memp;

            switch (type) {
            #if LWIP_RAW
                case memp_t.MEMP_RAW_PCB:
                    memp = new raw_pcb(this);
                    break;
            #endif
            #if LWIP_UDP
            case memp_t.MEMP_UDP_PCB:
                memp = new udp_pcb(this);
                break;
            #endif
            #if LWIP_TCP
            case memp_t.MEMP_TCP_PCB:
                memp = new tcp_pcb(this);
                break;
            case memp_t.MEMP_TCP_PCB_LISTEN:
                memp = new tcp_pcb_listen(this);
                break;
            case memp_t.MEMP_TCP_SEG:
                memp = new tcp_seg(this);
                break;
            #endif
            #if IP_REASSEMBLY
            case memp_t.MEMP_REASSDATA:
                memp = new ip_reassdata(this);
                break;
            case memp_t.MEMP_FRAG_PBUF:
                memp = new frag_pbuf(this);
                break;
            #endif
            #if LWIP_NETCONN
            case memp_t.MEMP_NETBUF:
                memp = new netbuf(this);
                break;
            case memp_t.MEMP_NETCONN:
                memp = new netconn(this);
                break;
            #endif
            #if false //!NO_SYS
            case memp_t.MEMP_TCPIP_MSG_API:
                memp = new tcpip_msg(this);
                break;
            case memp_t.MEMP_TCPIP_MSG_INPKT:
                memp = new tcpip_msg(this);
                break;
            #endif
            #if LWIP_ARP && ARP_QUEUEING
            case memp_t.MEMP_ARP_QUEUE:
                memp = new etharp_q_entry(this);
                break;
            #endif
            #if LWIP_IGMP
            case memp_t.MEMP_IGMP_GROUP:
                memp = new igmp_group(this);
                break;
            #endif
            #if false //(!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))
            case memp_t.MEMP_SYS_TIMEOUT:
                memp = new sys_timeo(this);
                break;
            #endif
            #if LWIP_SNMP
            case memp_t.MEMP_SNMP_ROOTNODE:
                memp = new mib_list_rootnode(this);
                break;
            case memp_t.MEMP_SNMP_NODE:
                memp = new mib_list_node(this);
                break;
            case memp_t.MEMP_SNMP_VARBIND:
                memp = new snmp_varbind(this);
                break;
            case memp_t.MEMP_SNMP_VALUE:
                memp = new snmp_value(this);
                break;
            #endif
            #if LWIP_DNS && LWIP_SOCKET
            case memp_t.MEMP_NETDB:
                memp = new netdb(this);
                break;
            #endif
            #if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
            case memp_t.MEMP_LOCALHOSTLIST:
                memp = new local_hostlist_entry(this);
                break;
            #endif
            #if PPP_SUPPORT && PPPOE_SUPPORT
            case memp_t.MEMP_PPPOE_IF:
                memp = new pppoe_softc(this);
                break;
            #endif
            default:
                throw new InvalidOperationException();
            }

            memp._type = type;
            memp_heap.AddLast(memp);
            return memp;
        }
Beispiel #2
0
        internal memp memp_malloc(memp_t type)
        {
            memp memp;

            switch (type)
            {
#if LWIP_RAW
            case memp_t.MEMP_RAW_PCB:
                memp = new raw_pcb(this);
                break;
#endif
#if LWIP_UDP
            case memp_t.MEMP_UDP_PCB:
                memp = new udp_pcb(this);
                break;
#endif
#if LWIP_TCP
            case memp_t.MEMP_TCP_PCB:
                memp = new tcp_pcb(this);
                break;

            case memp_t.MEMP_TCP_PCB_LISTEN:
                memp = new tcp_pcb_listen(this);
                break;

            case memp_t.MEMP_TCP_SEG:
                memp = new tcp_seg(this);
                break;
#endif
#if IP_REASSEMBLY
            case memp_t.MEMP_REASSDATA:
                memp = new ip_reassdata(this);
                break;

            case memp_t.MEMP_FRAG_PBUF:
                memp = new frag_pbuf(this);
                break;
#endif
#if LWIP_NETCONN
            case memp_t.MEMP_NETBUF:
                memp = new netbuf(this);
                break;

            case memp_t.MEMP_NETCONN:
                memp = new netconn(this);
                break;
#endif
#if false //!NO_SYS
            case memp_t.MEMP_TCPIP_MSG_API:
                memp = new tcpip_msg(this);
                break;

            case memp_t.MEMP_TCPIP_MSG_INPKT:
                memp = new tcpip_msg(this);
                break;
#endif
#if LWIP_ARP && ARP_QUEUEING
            case memp_t.MEMP_ARP_QUEUE:
                memp = new etharp_q_entry(this);
                break;
#endif
#if LWIP_IGMP
            case memp_t.MEMP_IGMP_GROUP:
                memp = new igmp_group(this);
                break;
#endif
#if false //(!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))
            case memp_t.MEMP_SYS_TIMEOUT:
                memp = new sys_timeo(this);
                break;
#endif
#if LWIP_SNMP
            case memp_t.MEMP_SNMP_ROOTNODE:
                memp = new mib_list_rootnode(this);
                break;

            case memp_t.MEMP_SNMP_NODE:
                memp = new mib_list_node(this);
                break;

            case memp_t.MEMP_SNMP_VARBIND:
                memp = new snmp_varbind(this);
                break;

            case memp_t.MEMP_SNMP_VALUE:
                memp = new snmp_value(this);
                break;
#endif
#if LWIP_DNS && LWIP_SOCKET
            case memp_t.MEMP_NETDB:
                memp = new netdb(this);
                break;
#endif
#if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
            case memp_t.MEMP_LOCALHOSTLIST:
                memp = new local_hostlist_entry(this);
                break;
#endif
#if PPP_SUPPORT && PPPOE_SUPPORT
            case memp_t.MEMP_PPPOE_IF:
                memp = new pppoe_softc(this);
                break;
#endif
            default:
                throw new InvalidOperationException();
            }

            memp._type = type;
            memp_heap.AddLast(memp);
            return(memp);
        }