common/argus_util.c fails to build in RC24

Peter Van Epp vanepp at sfu.ca
Tue Aug 8 11:17:10 EDT 2006


On Tue, Aug 08, 2006 at 11:58:31AM +0200, Christoph Badura wrote:
> Compiling RC24 of both argus and argus-clients fails in common/argus_util.c.
> 
> I'm surprised that it fails because different structure members are missing.
> Is the code in the common subdirectory not common between the server and
> the clients?
> 
	While you want to wait for the official fix from Carter (because I'm
not sure this is entirely correct and what he meant) this patch should fix
this (and another one in user data display) far enough for it to compile and
run. The server code has been separated from the client code to allow different
update cycles so they aren't necessarily identical. 

Peter Van Epp / Operations and Technical Support 
Simon Fraser University, Burnaby, B.C. Canada



*** common/argus_util.c.orig	Fri Aug  4 11:19:15 2006
--- common/argus_util.c	Fri Aug  4 12:05:41 2006
***************
*** 11243,11250 ****
                       rtcpObj->dst.rh_len   = ntohs(rtcpObj->dst.rh_len);
                       rtcpObj->dst.rh_ssrc  = ntohl(rtcpObj->dst.rh_ssrc);
  
!                      rtcpObj->src_pkt_drop = ntohs(rtcpObj->src_pkt_drop);
!                      rtcpObj->dst_pkt_drop = ntohs(rtcpObj->dst_pkt_drop);
                       break;
                    }
                 }
--- 11243,11250 ----
                       rtcpObj->dst.rh_len   = ntohs(rtcpObj->dst.rh_len);
                       rtcpObj->dst.rh_ssrc  = ntohl(rtcpObj->dst.rh_ssrc);
  
!                      rtcpObj->sdrop = ntohs(rtcpObj->sdrop);
!                      rtcpObj->ddrop = ntohs(rtcpObj->ddrop);
                       break;
                    }
                 }
***************
*** 11658,11665 ****
                       rtcpObj->dst.rh_len   = htons(rtcpObj->dst.rh_len);
                       rtcpObj->dst.rh_ssrc  = htonl(rtcpObj->dst.rh_ssrc);
  
!                      rtcpObj->src_pkt_drop = htons(rtcpObj->src_pkt_drop);
!                      rtcpObj->dst_pkt_drop = htons(rtcpObj->dst_pkt_drop);
                       break;
                    }
                 }
--- 11658,11665 ----
                       rtcpObj->dst.rh_len   = htons(rtcpObj->dst.rh_len);
                       rtcpObj->dst.rh_ssrc  = htonl(rtcpObj->dst.rh_ssrc);
  
!                      rtcpObj->sdrop = htons(rtcpObj->sdrop);
!                      rtcpObj->ddrop = htons(rtcpObj->ddrop);
                       break;
                    }
                 }
***************
*** 13494,13504 ****
                       case ARGUS_V2_DSTUSRDATA_DSR_STATUS: {
                          struct ArgusDataStruct *user = (struct ArgusDataStruct *)dsr;
                          struct ArgusV2UserStruct *nv2user = (struct ArgusV2UserStruct *)hdrs[ARGUS_V2_DSTUSRDATA_DSR_INDEX];
                          user->hdr.type              = ARGUS_DATA_DSR;     
                          user->hdr.subtype           =  ARGUS_LEN_16BITS | ARGUS_DST_DATA;
                          user->hdr.argus_dsrvl16.len = nv2user->length + 1;
!                         user->size                  = nv2user->length * 4;
!                         user->count                 = user->size;
  
                          bcopy (&nv2user->data, &user->array, (nv2user->length - 1) * 4);
                          dsr += user->hdr.argus_dsrvl16.len;
--- 13494,13506 ----
                       case ARGUS_V2_DSTUSRDATA_DSR_STATUS: {
                          struct ArgusDataStruct *user = (struct ArgusDataStruct *)dsr;
                          struct ArgusV2UserStruct *nv2user = (struct ArgusV2UserStruct *)hdrs[ARGUS_V2_DSTUSRDATA_DSR_INDEX];
+                         int len = (nv2user->length - 1) * 4;
+                         len = (len < argus2->argus_far.dst.appbytes) ? len : argus2->argus_far.dst.appbytes;
                          user->hdr.type              = ARGUS_DATA_DSR;     
                          user->hdr.subtype           =  ARGUS_LEN_16BITS | ARGUS_DST_DATA;
                          user->hdr.argus_dsrvl16.len = nv2user->length + 1;
!                         user->size                  = (nv2user->length - 1) * 4;
!                         user->count                 = len;
  
                          bcopy (&nv2user->data, &user->array, (nv2user->length - 1) * 4);
                          dsr += user->hdr.argus_dsrvl16.len;



More information about the argus mailing list