#define BASE_PORT 5100
#define AC_QUEUES 4
#define MAX_SENDENDPOINTS 10
-#define MTU 1450 //1500 minus something for sure
+#define MTU 800
enum { AC_VO = 0,
};
struct {
- struct send_endpoint epoint[MAX_SENDENDPOINTS];
+ struct send_endpoint epoint[1];
unsigned int nr_epoints;
} sendpoints;
int main(int argc, char *argv[])
{
- int ac, rc;
+ int ac, i, rc;
pthread_attr_t attr;
pthread_t thread;
sendpoints.epoint[AC_VI].period_nsec = 19080;
sendpoints.epoint[AC_VO].ac = AC_VO;
- sendpoints.epoint[AC_VO].period_nsec = 90000000;
+ sendpoints.epoint[AC_VO].period_nsec = 300000;
*/
- sendpoints.epoint[AC_BE].ac = AC_BE;
- sendpoints.epoint[AC_BE].period_nsec = 0;
+ /*sendpoints.epoint[AC_BE].ac = AC_BE;
+ sendpoints.epoint[AC_BE].period_nsec = 760000;
sendpoints.epoint[AC_BK].ac = AC_BK;
- sendpoints.epoint[AC_BK].period_nsec = 757;
+ sendpoints.epoint[AC_BK].period_nsec = 757000;
sendpoints.epoint[AC_VI].ac = AC_VI;
- sendpoints.epoint[AC_VI].period_nsec = 90000000;
+ sendpoints.epoint[AC_VI].period_nsec = 9908000;
sendpoints.epoint[AC_VO].ac = AC_VO;
sendpoints.epoint[AC_VO].period_nsec = 90000000;
+ */
+
+ sendpoints.epoint[0].ac = AC_BE;
+ sendpoints.epoint[0].period_nsec = 1000000;
+ sendpoints.nr_epoints = 1;
if (signal(SIGTERM, stopper) == SIG_ERR) {
perror("Error in signal registration");
exit(1);
}
- sendpoints.nr_epoints = 4;
+ /* create four receivers each per AC */
for (ac = AC_QUEUES - 1; ac >= 0; ac--) {
ac_sockfd[ac] = create_ac_socket(ac);
rc = pthread_create(&thread, &attr, receiver, (void*) ac);
printf("Error while creating receiver %d\n",rc);
return 1;
}
-
- rc = pthread_create(&thread, &attr, sender, (void*) &sendpoints.epoint[ac]);
+ }
+
+ /* create sendpoints */
+ for (i = 0; i < sendpoints.nr_epoints; i++) {
+ rc = pthread_create(&thread, &attr, sender, (void*) &sendpoints.epoint[i]);
if (rc) {
printf("Error while creating sender %d\n",rc);
return 1;