Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

UDP Offload not receiving

$
0
0
Hi I am using the UDP Offload example. the only difference is that instead of the packet checker i have a custom component that just outputs the avalon ST signal for my hardware to use. Here is the code i used to initialize the socket:
Code:

        /* Create socket for sending/receiving datagrams */
        if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
                printf("socket() failed");


        /* Construct local address structure */
        memset(&my_Addr, 0, sizeof(my_Addr)); /* Zero out structure */
        my_Addr.sin_family = AF_INET; /* Internet address family */
        my_Addr.sin_addr.s_addr = htons(INADDR_ANY); /* Any incoming interface */
        my_Addr.sin_port = htons(PORT_0); /* Local port */


        /* Bind to the local address */
        if (bind(sock, (struct sockaddr *) &my_Addr, sizeof(my_Addr)) < 0)
                printf("bind() failed");


        if (clear_udp_payload_extractor_counter (EXTRACTOR_0_BASE))
                printf("Clear extractor failed\n");


        result = map_udp_port_to_channel((void*)(UDP_MAPPER_BASE), 0, PORT_0);
        if (result)
                printf("Port Mapping Failed: %d\n", result);


        for (;;) /* Run forever */
        {
                // Hang out
                usleep(10000);
               
        }

Then i use a UDP sender that i know works to send udp packets to the board from my PC. But if i use a packet sniffer nothing actually gets to the board. it just looks like it is not listening at that IP or port.

Now i am not sure if i need to initialize anything else for the hardware to work like its suppose to. Or Do i absolutely need the packet checker.

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>