Heavily modified and extended for DOSX by G.Vanem <giva@bgnett.no>
Definition in file pcpkt.c.
Go to the source code of this file.
Functions | |
| void | get_init_stats (void) |
| void (__cdecl _far *pkt_enque_ptr)(BYTE _far *buf | |
| int | setup_rmode_callback (void) |
| int | lock_code_and_data (void) |
| int | unlock_code_and_data (void) |
| int | find_vector (int first, int num) |
| int | setup_pkt_inf (void) |
| void | get_rmode_data (void *dest, unsigned size, WORD seg, WORD ofs) |
| Return PKTDRVR data at seg:ofs, Copy to 'dest'. | |
| BOOL | pkt_api_entry (IREGS *reg, unsigned called_from_line) |
| The API entry to the network link-driver. | |
| const char * | pkt_strerror (int code) |
| Return textual error representing error-code. | |
| void | dump_asm4 (void) |
| void * | pkt_tx_buf (void) |
| Return address of DOS memory Tx-buffer. | |
| int | pkt_set_access (void) |
| Setup the receiver upcall handler. | |
| int | pkt_drvr_info (void) |
| Fetch the PKTDRVR information. | |
| int | pkt_get_params (struct PktParameters *params) |
| Get PKTDRVR parameters (MTU, version etc.). | |
| int | pkt_get_mtu (void) |
| Return PKTDRVR maximum-transmit-units (MTU). | |
| int | pkt_get_mac_len (void) |
| Return length of MAC address. | |
| int | pkt_get_api_ver (DWORD *ver) |
| Return version of spec. | |
| int | pkt_get_drvr_ver (WORD *major, WORD *minor) |
| Return version of PKTDRVR. | |
| int | pkt_get_vector (void) |
| Return PKTDRVR vector. | |
| int | pkt16_drvr_init (mac_address *mac_addr) |
| Called from pkt_eth_init() to search for PKTDRVR. | |
| int | pkt_release_handle (WORD handle) |
| Release the allocated protocol handle. | |
| int | pkt_reset_handle (WORD handle) |
| Reset the driver-state associated with handle. | |
| void | release_callback (void) |
| void | release_real_mem (void) |
| Release allocated DOS memory. | |
| int DTOR | pkt_release (void) |
| void | pkt_enqueue (unsigned rxBuf, WORD rxLen) static void __cdecl _far pkt_enqueue(BYTE _far *rxBuf |
| Enqueue a received packet into '_pkt_inf->pkt_queue'. | |
| int | pkt_send (const void *tx, int length) |
| Send a link-layer frame. | |
| int | pkt_get_addr (mac_address *mac) |
| Return the MAC address. | |
| int | pkt_set_addr (const void *addr) |
| Set a new MAC source address. | |
| int | pkt_get_stats (struct PktStats *stats, struct PktStats *total) |
| Get PKTDRVR statistics. | |
| int | pkt_get_vjstats (struct slcompress *vjstats) |
| int | pkt_get_cstate (struct cstate *cs, WORD cstate_ofs) |
| int | pkt_buf_wipe (void) |
| Clear the receive queue. | |
| void | pkt_free_pkt (const void *pkt) |
| Release a packet from the receive queue. | |
| int | pkt_waiting (void) |
| Return number of packets waiting in queue. | |
| DWORD | pkt_dropped (void) |
| Return number of packets dropped. | |
| int | parse_config_pass_1 (void) |
| Search WATTCP.CFG file for "PKT.VECTOR = 0x??" etc. | |
| int | pkt_eth_init (mac_address *addr) |
| Initialise Packet driver interface. | |
| BOOL | check_intr_num (WORD intr_num) |
| Check a single interrupt vector for signature string "PKT DRVR". | |
| void | _unlock (const void *addr, DWORD size) |
| int | pkt_set_rcv_mode (int mode) |
| Sets the receive mode of the interface. | |
| int | pkt_get_rcv_mode (void) |
| Gets the receive mode of the interface (can never be mode 0). | |
| int | pkt_get_multicast_list (mac_address *listbuf, int *lenp) |
| Gets the current list of multicast addresses from the PKTDRVR. | |
| int | pkt_set_multicast_list (const void *listbuf, int len) |
| Sets the list of multicast addresses for which the PKTDRVR is responsible. | |
Variables | |
| WORD | _pktdevclass = PDCLASS_UNKNOWN |
| Ethernet, Token, FDDI etc. | |
| WORD | _pkt_ip_ofs = 0 |
| ofs from link-layer head to ip | |
| WORD | _pkt_type_ofs = 0 |
| ofs from link-layer head to type | |
| BOOL | _pktserial = FALSE |
| using serial driver, SLIP/PPP | |
| BYTE | _pktdevlevel = 1 |
| Device level. | |
| int | _pkt_rxmode = RXMODE_BROADCAST |
| active receive mode | |
| int | _pkt_rxmode0 = -1 |
| startup receive mode | |
| int | _pkt_errno = 0 |
| error code set in pcpkt.c API | |
| const char * | pkt_error = NULL |
| Last pkt error string. | |
| int | _pkt_forced_rxmode = -1 |
| char | _pktdrvrname [20] = "unknown" |
| pkt_info * | _pkt_inf = NULL |
| module data that will be locked | |
| char | pkt_sign [] = "PKT DRVR" |
| WORD | pkt_interrupt = 0 |
| DWORD | pkt_drop_cnt = 0 |
| BYTE | pkt_txretries = 2 |
| int | pkt_txwait = 0 |
| BOOL | pkt_use_near = FALSE |
| BOOL | pkt_do_reset = FALSE |
| int | pkt_drvr_ver = 0 |
| int | pkt_num_rx_bufs = RX_BUFS |
| PktStats | init_stats |
| PktParameters | pkt_params |
| BOOL | got_params = FALSE |
| REALPTR | rm_base |
| _go32_dpmi_seginfo | rm_cb |
| WORD | pkt_inf_sel |
| WORD | len |
| WORD | cstate_dseg = 0 |
| Get VJ-compression statistics from pkt-driver. | |
|
|
Search WATTCP.CFG file for "PKT.VECTOR = 0x??" etc. Accept "0x20 - 0xFF". Definition at line 1380 of file pcpkt.c. References ARG_ATOB, ARG_ATOI, and ARG_ATOX_B. |
|
|
Called from pkt_eth_init() to search for PKTDRVR.
References _pkt_errno, _pkt_rxmode, _pkt_rxmode0, _pktdevlevel, _pktserial, pkt_drvr_info(), pkt_get_addr(), pkt_get_params(), pkt_get_rcv_mode(), pkt_release(), pkt_set_access(), pkt_set_rcv_mode(), pkt_strerror(), RXMODE_PROMISCOUS, and setup_pkt_inf(). |
|
||||||||||||
|
The API entry to the network link-driver. Use either protected mode interface via a call to dynamically loaded module (not yet) or issue an interrupt for the real-mode PKTDRVR. Return TRUE if CARRY is clear, else set _pkt_errno and return FALSE.
References _pkt_errno. |
|
|
Fetch the PKTDRVR information. Device level, class and name. Definition at line 370 of file pcpkt.c. References _pkt_errno, _pkt_inf, _pkt_ip_ofs, _pkt_type_ofs, _pktdevclass, _pktdevlevel, _pktserial, get_rmode_data(), pkt_info::is_serial, pkt_info::pkt_ip_ofs, and pkt_info::pkt_type_ofs. |
|
||||||||||||
|
Enqueue a received packet into '_pkt_inf->pkt_queue'. This routine is called from pkt_receiver_rm/_pm(). The packet has been copied to rx_buffer (in DOS memory) by the packet-driver. We now must copy it to correct queue. Interrupts are disabled on entry. Note 1: For real-mode targets SS and SP have been setup to a small work stack in asmpkt.asm (SS = CS). The stack can only take 64 pushes, hence use few local variables here. Note 2: The C-compiler must be told NOT to use register calling for this routine (MUST use __cdecl) because it's called from asmpkt.asm via `pkt_enque_ptr' function pointer. Note 3: Watcom/DOS4GW targets doesn't use real->prot mode upcall (RMCB), but does the following in asmpkt4.asm instead. Note 4: For DOSX targets, all code from pkt_enqueue() down to _pkt_end() must be locked in memory. HACK: For real-mode targets this routine is called via the `pkt_enque_ptr' function pointer. This was the only way I could avoid a fixup error for small-model programs. |
|
|
Initialise Packet driver interface. First determine vector to use; if WATTCP.CFG specifies a "PKT.VECTOR = 0xNN", use that vector, else search for PKTDRVR between PKT_FIRST_VEC and PKT_LAST_VEC (0x60 - 0x80). If the driver is outside this range, user must specify one with "PKT.VECTOR = 0x??". If DOSX, probe and initialise protected-mode driver (not operational). Call pkt16_drvr_init() to initialise API. Definition at line 1419 of file pcpkt.c. |
|
|
Release a packet from the receive queue. If USE_FAST_PKT, pkt has already been free'd. Just update drop count. Definition at line 1319 of file pcpkt.c. |
|
|
Return version of spec. this PKTDRVR conforms to.
|
|
|
Return length of MAC address.
References _pktdevclass, and arcnet_address. |
|
|
Return PKTDRVR maximum-transmit-units (MTU).
|
|
||||||||||||
|
Gets the current list of multicast addresses from the PKTDRVR.
|
|
|
Gets the receive mode of the interface (can never be mode 0).
|
|
||||||||||||
|
Get PKTDRVR statistics. Return both 'stats' for current session and 'total' statistics since driver loaded. Definition at line 1213 of file pcpkt.c. |
|
|
|
|
||||||||||||
|
Send a link-layer frame. For PPP/SLIP 'tx' contains no MAC-header. For EtherNet, Token-Ring, ARCNET and FDDI, 'tx' contains the complete frame.
|
|
|
Setup the receiver upcall handler. The handler is called for all packets matching current receive mode. In mode 3 all broadcast and directed packets. Definition at line 320 of file pcpkt.c. References _pkt_errno, _pkt_inf, _pktdevclass, pkt_info::handle, pkt_info::rm_seg, and WORD. |
|
||||||||||||
|
Sets the list of multicast addresses for which the PKTDRVR is responsible.
|
|
|
Sets the receive mode of the interface. mode is one of the following modes:
|
|
|
Return address of DOS memory Tx-buffer. For DOS4GW/X32VM (and djgpp with near-ptrs) targets, return near address of transmit buffer located in DOS memory. Definition at line 290 of file pcpkt.c. |
|
|
References _pkt_inf, pkt_info::dos_ds, pkt_ringbuf::dos_ofs, DWORD, pkt_info::pkt_queue, pkt_info::rx_buf, and pkt_info::use_near_ptr. |
|
|
Get VJ-compression statistics from pkt-driver. Only DOS-PPP ver 0.6+ supports the PD_GET_VJSTATS (0x81) call. Definition at line 1267 of file pcpkt.c. |
1.3.8