T.R | Title | User | Personal Name | Date | Lines |
---|
471.1 | | MIPSBX::thomas | The Code Warrior | Thu Feb 06 1992 11:54 | 1 |
| Ethernet, SAP, or SNAPSAP??
|
471.2 | here is sockaddr_dl setup | DMEICE::PAGE | | Fri Feb 07 1992 09:02 | 42 |
| Here is the code setup I use in the sendto:
/* build a sockaddr_dl the hard way */
struct sockaddr_dl toSock;
bzero((char *)&toSock,sizeof(struct sockaddr_dl));
toSock.dli_family = AF_DLI;
strcpy((char *)toSock.dli_device.dli_devname,"fza");
toSock.dli_device.dli_devnumber = 0;
toSock.dli_substructype = DLI_802;
toSock.choose_addr.dli_802addr.ioctl = DLI_EXCLUSIVE;
toSock.choose_addr.dli_802addr.svc = TYPE1;
toSock.choose_addr.dli_802addr.eh_802.ssap = SNAP_SAP;
toSock.choose_addr.dli_802addr.eh_802.dsap = SNAP_SAP;
toSock.choose_addr.dli_802addr.eh_802.ctl.U_fmt=(u_char)UI_NPCMD;
/* set protocol ID */
toSock.choose_addr.dli_802addr.eh_802.osi_pi[0] = 0;
toSock.choose_addr.dli_802addr.eh_802.osi_pi[1] = 0x40;
toSock.choose_addr.dli_802addr.eh_802.osi_pi[2] = 3;
toSock.choose_addr.dli_802addr.eh_802.osi_pi[3] = 0;
toSock.choose_addr.dli_802addr.eh_802.osi_pi[4] = 0;
/* set destination address */
toSock.choose_addr.dli_802addr.eh_802.dst[0] = broadcastAddress[0];
toSock.choose_addr.dli_802addr.eh_802.dst[1] = broadcastAddress[1];
toSock.choose_addr.dli_802addr.eh_802.dst[2] = broadcastAddress[2];
toSock.choose_addr.dli_802addr.eh_802.dst[3] = broadcastAddress[3];
toSock.choose_addr.dli_802addr.eh_802.dst[4] = broadcastAddress[4];
toSock.choose_addr.dli_802addr.eh_802.dst[5] = broadcastAddress[5];
if ( sendto(
socketTable[channel],
(char *)msg,
msglen < 46 ? 46 : msglen,
0,
(struct sockaddr *)&toSock,
sizeof(struct sockaddr_dl) ) < 0 )
|
471.3 | | MIPSBX::thomas | The Code Warrior | Fri Feb 07 1992 11:06 | 6 |
| Also do a
int bufsiz = 4478;
setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bufsiz, sizeof(bufsiz));
This will get around the problem.
|
471.4 | fix worked, other setsockopts ? | DMEICE::PAGE | | Fri Feb 07 1992 12:48 | 7 |
| It worked. Do you also have a document describing other
setsockopt functions? I would like to increase the number
of buffers that I can receive on a socket before I have to
recv them. Can I do this? My application looses buffers
that are sent via type I class I transmission if the buffers
are sent in bursts from other hosts.
...Cal
|
471.5 | | MIPSBX::thomas | The Code Warrior | Fri Feb 07 1992 12:55 | 1 |
| There's an SO_RCVBUF as well (maxes at 65535).
|
471.6 | 2 bytes lost at end | DMEICE::PAGE | | Tue Feb 11 1992 11:38 | 11 |
| I have just noted that the last two bytes of a sendto/recvfrom
get zeroed after the recvfrom. Is this a known bug?
The count of bytes is the same on transmission as reception,
but, the last two bytes of any buffer get received
as zeroes.
Is this a known bug?
...Cal
|
471.7 | | MIPSBX::thomas | The Code Warrior | Tue Feb 11 1992 13:39 | 1 |
| That seems unlikely. I'd check you application first for bugs...
|