Ethereal-dev: [Ethereal-dev] porting to ReliantUNIX

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Dr. Uwe Girlich" <Uwe.Girlich@xxxxxxxxxxx>
Date: Tue, 28 Nov 2000 07:25:54 +0100
Hello!

>From time to time I try to overcome some obstacles, which separate me from
my goal to create an ethereal package for ReliantUNIX 5.43 .. 5.45.

My current problem is packet-afs.c. I use gcc 2.95.2 for compiling but the
original Siemens assembler and linker for the later stages. The routine
dissect_fs_reply() has a simple switch statement with many macros in it. It
is obvious, that this code expands enormously. The MIPS assembler is not able
to handle this file at all.

After a bit of code optimization (in many switch cases is the same or very
similar code) the assembler does not even generate a warning any more.

I'm not so involved in afs, so I did not just check in the changes but provide
the patch here for further inspection. Does it look good?

Bye, Uwe

*** packet-afs.c.org	Mon Nov 20 05:36:07 2000
--- packet-afs.c	Sat Nov 25 09:52:35 2000
***************
*** 542,564 ****
  				OUT_FS_AFSVolSync();
  				break;	
  			case 133: /* Store data */
- 				OUT_FS_AFSFetchStatus("Status");
- 				OUT_FS_AFSVolSync();
- 				break;
  			case 134: /* Store ACL */
- 				OUT_FS_AFSFetchStatus("Status");
- 				OUT_FS_AFSVolSync();
- 				break;
  	 		case 135: /* Store status */
- 				OUT_FS_AFSFetchStatus("Status");
- 				OUT_FS_AFSVolSync();	
- 				break;
  			case 136: /* Remove file */
  				OUT_FS_AFSFetchStatus("Status");
  				OUT_FS_AFSVolSync();
  				break;
  			case 137: /* create file */
! 				OUT_FS_AFSFid("New File");
  				OUT_FS_AFSFetchStatus("File Status");
  				OUT_FS_AFSFetchStatus("Directory Status");
  				OUT_FS_AFSCallBack();
--- 542,558 ----
  				OUT_FS_AFSVolSync();
  				break;	
  			case 133: /* Store data */
  			case 134: /* Store ACL */
  	 		case 135: /* Store status */
  			case 136: /* Remove file */
  				OUT_FS_AFSFetchStatus("Status");
  				OUT_FS_AFSVolSync();
  				break;
  			case 137: /* create file */
! 			case 141: /* make dir */
! 			case 161: /* lookup */
! 			case 163: /* dfs symlink */
! 				OUT_FS_AFSFid((opcode == 137)? "New File" : ((opcode == 141)? "New Directory" : "File"));
  				OUT_FS_AFSFetchStatus("File Status");
  				OUT_FS_AFSFetchStatus("Directory Status");
  				OUT_FS_AFSCallBack();
***************
*** 571,612 ****
  				break;
  			case 139: /* symlink */
  				OUT_FS_AFSFid("Symlink");
- 				OUT_FS_AFSFetchStatus("Symlink Status");
- 				OUT_FS_AFSFetchStatus("Directory Status");
- 				OUT_FS_AFSVolSync();
- 				break;
  			case 140: /* link */
  				OUT_FS_AFSFetchStatus("Symlink Status");
- 				OUT_FS_AFSFetchStatus("Directory Status");
- 				OUT_FS_AFSVolSync();
- 				break;	
- 			case 141: /* make dir */
- 				OUT_FS_AFSFid("New Directory");
- 				OUT_FS_AFSFetchStatus("File Status");
- 				OUT_FS_AFSFetchStatus("Directory Status");
- 				OUT_FS_AFSCallBack();
- 				OUT_FS_AFSVolSync();
- 				break;
  			case 142: /* rmdir */
  				OUT_FS_AFSFetchStatus("Directory Status");
  				OUT_FS_AFSVolSync();
  				break;
  			case 143: /* old set lock */
- 				/* nothing returned */
- 				break;
  			case 144: /* old extend lock */
- 				/* nothing returned */
- 				break;
  			case 145: /* old release lock */
  				/* nothing returned */
  				break;
  			case 146: /* get statistics */
  				OUT_FS_ViceStatistics();
  				break;
- 			case 147: /* give up callbacks */
- 				/* nothing returned */
- 				break;
  			case 148: /* get volume info */
  				OUT_FS_VolumeInfo();
  				break;
  			case 149: /* get volume status */
--- 565,589 ----
  				break;
  			case 139: /* symlink */
  				OUT_FS_AFSFid("Symlink");
  			case 140: /* link */
  				OUT_FS_AFSFetchStatus("Symlink Status");
  			case 142: /* rmdir */
  				OUT_FS_AFSFetchStatus("Directory Status");
  				OUT_FS_AFSVolSync();
  				break;
  			case 143: /* old set lock */
  			case 144: /* old extend lock */
  			case 145: /* old release lock */
+ 			case 147: /* give up callbacks */
+ 			case 150: /* set volume status */
+ 			case 152: /* check token */ 
  				/* nothing returned */
  				break;
  			case 146: /* get statistics */
  				OUT_FS_ViceStatistics();
  				break;
  			case 148: /* get volume info */
+ 			case 154: /* n-get-volume-info */
  				OUT_FS_VolumeInfo();
  				break;
  			case 149: /* get volume status */
***************
*** 615,646 ****
  				OUT_STRING(hf_afs_fs_offlinemsg);
  				OUT_STRING(hf_afs_fs_motd);
  				break;
- 			case 150: /* set volume status */
- 				/* nothing returned */
- 				break;
  			case 151: /* root volume */
  				OUT_STRING(hf_afs_fs_volname);
  				break;
- 			case 152: /* check token */ 
- 				/* nothing returned */
- 				break;
  			case 153: /* get time */
  				OUT_TIMESTAMP(hf_afs_fs_timestamp);
  				break;
- 			case 154: /* n-get-volume-info */
- 				OUT_FS_VolumeInfo();
- 				break;
  			case 155: /* bulk status */
  				OUT_FS_AFSBulkStats();
  				OUT_FS_AFSCBs();
  				OUT_FS_AFSVolSync();
  				break;
  			case 156: /* set lock */
- 				OUT_FS_AFSVolSync();
- 				break;
  			case 157: /* extend lock */
- 				OUT_FS_AFSVolSync();
- 				break;
  			case 158: /* release lock */
  				OUT_FS_AFSVolSync();
  				break;
--- 592,610 ----
***************
*** 652,674 ****
  				OUT_DATE(hf_afs_fs_xstats_timestamp);
  				OUT_FS_AFS_CollData();
  				break;
- 			case 161: /* lookup */
- 				OUT_FS_AFSFid("File");
- 				OUT_FS_AFSFetchStatus("File Status");
- 				OUT_FS_AFSFetchStatus("Directory Status");
- 				OUT_FS_AFSCallBack();
- 				OUT_FS_AFSVolSync();
- 				break;
  			case 162: /* flush cps */
  				OUT_UINT(hf_afs_fs_cps_spare2);
  				OUT_UINT(hf_afs_fs_cps_spare3);
- 				break;
- 			case 163: /* dfs symlink */
- 				OUT_FS_AFSFid("File");
- 				OUT_FS_AFSFetchStatus("File Status");
- 				OUT_FS_AFSFetchStatus("Directory Status");
- 				OUT_FS_AFSCallBack();
- 				OUT_FS_AFSVolSync();
  				break;
  		}
  	}
--- 616,624 ----