System information

8.2 Network Card
struct chn_packet packet[CHN_BUFFER_LENGTH];
};
struct chn_sharedmem {
unsigned long status;
unsigned long jiffies[2];
struct chn_buffer buffer[2];
};
The structure chn_sharedmem describes the shared SRAM content. The two transfer
FIFOs are represented by the structure chn_buffer. One FIFO contain 32 packets. A packet
is defined by the structure chn_packet. It contains a Linux network packet (sk_buf) with
a size of up to 1600 bytes.
The only difference between the host-side and the CHARM-side network driver is the
usage of the two transfer FIFOs. The CHARM driver uses the first FIFO for the incoming
data and the host side uses the second one to receive data. At the same time, the CHARM
sends the packet to the second FIFO and the host writes its packet to the first FIFO.
8.2.2 Network Masquerading
The host computer can use the CHARM-Host Network bridge to access the intranet or
Internet network. Therefore, the CHARM card has to forward the IP packets to its built-in
Ethernet interface. The CHARM has to support network address translation (NAT) to
route the network packets of the host computer to the Ethernet interface.
Figure 8.8 depicts the network masquerading of the CHARM card. Network packets sent
to the CHN network interface (IP 192.168.0.5) of the CHARM card are forwarded to the
Ethernet interface (IP 10.0.1.11). Thereby, the source address of the TCP/IP packet is
exchanged with the IP address of the Ethernet interface of the CHARM: 10.0.1.11 in this
case. If the host computer lost the network connection of its primary network interface, the
CHN interface can be used to access the network.
CHARM Host
CHNCHN
ETH
ETH
Intranet /
Internet
TCP/IP
TCP/IP
TCP/IP
192.168.0.5
192.168.0.4
10.0.1.7
10.0.1.11
Ethernet
PCI
Ethernet
Figure 8.8: Network connection of the host computer by the aid of the CHARM card. The
used IP addresses in the picture are one example of a possible network configu-
ration.
The CHARM network function can also get used as a hardware based firewall for the host
computer. The network traffic is filtered on the CHARM card. Software firewalls running
on the host computer can be avoided by manipulating the network drivers or the firewall
programs.
111