[Info-vax] Last note...

john.weed at triangleexperience.com john.weed at triangleexperience.com
Sat Aug 29 20:40:02 EDT 2015


If you're like me at all, you hate undefined (seemingly arbitrary) numeric constants floating around my code... like the magic number 9234 in the subject's solution. So, in case you're wondering, there is a MACRO ($LANUDEF) in the $LANUDEF.MLB macro library that has all sorts of constants that will help remove some of those strange numbers like 1500 (Ethernet packet size), 9234, etc.

The 9234 is ATM$C_MAX_PKTSIZE, and the better one to use is CSMACD$C_MAX_PKTSIZE_ETH.

Thanks again!

On Saturday, August 29, 2015 at 12:39:37 AM UTC-4, john... at triangleexperience.com wrote:
> Hey folks, 
> 
> I've been beating my head against a dull rock here; trying to do a simple filtered multicast read against a port on my rx2660. I've done this before, many years ago, and for some reason it simply isn't working now. I have a PC on the network running wire shark and it sees the packets just fine, with the expected destination address and protocol type. Source address matches the hardware address of the sending rx2660. 
> 
> If I just IO$_SETMODE the interface with NMA$C_PCLI_PRM set to NMA$C_STATE_ON, the packets come in fine. If, however, I try to set up the port for the protocol type (56-78) and NMA$C_PCLI_MCA set to a single multicast address (AB-00-04-00-12-34), I get nothing. 
> 
> Here is the code the runs in promiscuous mode that works...
> 
>         LOCAL
>             Channel : UNSIGNED WORD INITIAL (0),
>             IO_Buffer : $BBLOCK [8192],
>             IO_Buffer_Len : INITIAL (%ALLOCATION (IO_Buffer)),
>             IO_Status_Block : $BBLOCK [IOSB$C_LENGTH],
>             P2_Mode_Buffer      : BLOCK [18, BYTE]
>                                   PRESET (
>                                   [ 0, 0, 16, 0] = NMA$C_PCLI_ACC,
>                                   [ 2, 0, 16, 0] = NMA$C_ACC_EXC,
>                                   [ 4, 0, 16, 0] = 0,
>                                   [ 6, 0, 16, 0] = NMA$C_PCLI_FMT,
>                                   [10, 0, 16, 0] = 0,
>                                   [12, 0, 16, 0] = NMA$C_PCLI_PRM,
>                                   [14, 0, 16, 0] = NMA$C_STATE_ON,
>                                   [16, 0, 16, 0] = 0),
>             P2_Mode_Desc        : VECTOR [2, LONG]
>                                   PRESET ([0] = %ALLOCATION (P2_Mode_Buffer), [1] = P2_Mode_Buffer),
>             P5_Header_Info      : $BBLOCK [64],
>             Status;
> 
>         Status = $ASSIGN (DEVNAM=%ASCID '_EWB0:', CHAN=Channel);
> 
>         IF NOT .Status THEN $EXIT (CODE=.Status);
> 
>         Status = $QIOW (
>             EFN=EFN$C_ENF,
>             CHAN=.Channel,
>             FUNC=IO$_SETMODE+IO$M_CTRL+IO$M_STARTUP,
>             IOSB=IO_Status_Block,
>             P2=P2_Mode_Desc);
> 
>         IF .Status THEN Status = .IO_Status_Block [IOSB$W_STATUS];
> 
>         IF NOT .Status THEN $EXIT (CODE=.Status);
> 
>         Status = $QIOW (
>             EFN=EFN$C_ENF,
>             CHAN=.Channel,
>             FUNC=IO$_READVBLK,
>             IOSB=IO_Status_Block,
>             P1=IO_Buffer,
>             P2=.IO_Buffer_Len,
>             P5=P5_Header_Info);
> 
>         IF .Status THEN Status = .IO_Status_Block [IOSB$W_STATUS];
> 
>         IF NOT .Status THEN $EXIT (CODE=.Status);
> 
> Next, here is the code I am trying to get to work that filters for the multicast address AB0004001234 and protocol 5678.. which does not work (not packets received)
> 
>         LOCAL
>             Channel : UNSIGNED WORD INITIAL (0),
>             IO_Buffer : $BBLOCK [8192],
>             IO_Buffer_Len : INITIAL (%ALLOCATION (IO_Buffer)),
>             IO_Status_Block : $BBLOCK [IOSB$C_LENGTH],
>             P2_Mode_Buffer      : BLOCK [36, BYTE]
>                                   PRESET (
>                                   [ 0, 0, 16, 0] = NMA$C_PCLI_ACC,
>                                   [ 2, 0, 16, 0] = NMA$C_ACC_EXC,
>                                   [ 4, 0, 16, 0] = 0,
>                                   [ 6, 0, 16, 0] = NMA$C_PCLI_FMT,
>                                   [ 8, 0, 16, 0] = NMA$C_LINFM_ETH,
>                                   [10, 0, 16, 0] = 0,
>                                   [12, 0, 16, 0] = NMA$C_PCLI_PRM,
>                                   [14, 0, 16, 0] = NMA$C_STATE_OFF,
>                                   [16, 0, 16, 0] = 0,
>                                   [18, 0, 16, 0] = NMA$C_PCLI_PTY,
>                                   [20, 0, 16, 0] = %x'7856',
>                                   [22, 0, 16, 0] = 0,
>                                   [24, 0, 16, 0] = NMA$C_PCLI_MCA,
>                                   [26, 0, 16, 0] = 8,
>                                   [28, 0, 16, 0] = NMA$C_LINMC_SET,
>                                   [30, 0,  8, 0] = %x'AB',
>                                   [31, 0,  8, 0] = %x'00',
>                                   [32, 0,  8, 0] = %x'04',
>                                   [33, 0,  8, 0] = %x'00',
>                                   [34, 0,  8, 0] = %x'12',
>                                   [35, 0,  8, 0] = %x'34'),
>             P2_Mode_Desc        : VECTOR [2, LONG]
>                                   PRESET ([0] = %ALLOCATION (P2_Mode_Buffer), [1] = P2_Mode_Buffer),
>             P5_Header_Info      : $BBLOCK [64],
>             Status;
> 
>         Status = $ASSIGN (DEVNAM=%ASCID '_EWB0:', CHAN=Channel);
> 
>         IF NOT .Status THEN $EXIT (CODE=.Status);
> 
>         Status = $QIOW (
>             EFN=EFN$C_ENF,
>             CHAN=.Channel,
>             FUNC=IO$_SETMODE+IO$M_CTRL+IO$M_STARTUP,
>             IOSB=IO_Status_Block,
>             P2=P2_Mode_Desc);
> 
>         IF .Status THEN Status = .IO_Status_Block [IOSB$W_STATUS];
> 
>         IF NOT .Status THEN $EXIT (CODE=.Status);
> 
>         Status = $QIOW (
>             EFN=EFN$C_ENF,
>             CHAN=.Channel,
>             FUNC=IO$_READVBLK,
>             IOSB=IO_Status_Block,
>             P1=IO_Buffer,
>             P2=.IO_Buffer_Len,
>             P5=P5_Header_Info);
> 
>         IF .Status THEN Status = .IO_Status_Block [IOSB$W_STATUS];
> 
>         IF NOT .Status THEN $EXIT (CODE=.Status);
> 
> This is using the embedded controller of the rx2660 (EWA or EWB). 
> 
> Anyone have any good, working examples of reading multicast Ethernet frames using the NMA$C_PCLI_MCA setting?




More information about the Info-vax mailing list