summaryrefslogtreecommitdiff
path: root/debian/patches/fix-translator-functions.patch
blob: 1a40e4d8a1fe09638ecb2329b4a7e481a7ac8234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile
index 241b76d..5d27620 100644
--- a/libtrivfs/Makefile
+++ b/libtrivfs/Makefile
@@ -38,7 +38,7 @@ FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-stubs.c fsys-syncfs.c \
 	fsys-get-children.c fsys-get-source.c
 
 OTHERSRCS=demuxer.c protid-clean.c protid-dup.c cntl-create.c \
-	cntl-clean.c migsupport.c times.c startup.c open.c \
+	cntl-clean.c times.c startup.c open.c \
 	runtime-argp.c set-options.c append-args.c dyn-classes.c \
 	protid-classes.c cntl-classes.c
 
@@ -49,7 +49,7 @@ MIGSTUBS=fsServer.o ioServer.o fsysServer.o fsys_replyUser.o
 libname = libtrivfs
 HURDLIBS = fshelp iohelp ports shouldbeinlibc
 OBJS= $(sort $(subst .c,.o,$(SRCS)) $(MIGSTUBS))
-MIGSFLAGS=-imacros $(srcdir)/fsmutations.h
+MIGSFLAGS=-imacros $(srcdir)/mig-mutate.h
 MIGCOMSFLAGS = -prefix trivfs_
 installhdrs := trivfs.h
 mig-sheader-prefix = trivfs_
@@ -59,4 +59,4 @@ endif
 
 include ../Makeconf
 
-$(MIGSTUBS:%Server.o=%.sdefsi): $(srcdir)/fsmutations.h
+$(MIGSTUBS:%Server.o=%.sdefsi): $(srcdir)/mig-mutate.h
diff --git a/libtrivfs/fsmutations.h b/libtrivfs/fsmutations.h
deleted file mode 100644
index d81e5a8..0000000
--- a/libtrivfs/fsmutations.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-   Copyright (C) 1994,95,2002 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* Only CPP macro definitions should go in this file. */
-
-#define REPLY_PORTS
-
-#define FILE_INTRAN trivfs_protid_t trivfs_begin_using_protid (file_t)
-#define FILE_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
-
-#define IO_INTRAN trivfs_protid_t trivfs_begin_using_protid (io_t)
-#define IO_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
-
-#define FSYS_INTRAN trivfs_control_t trivfs_begin_using_control (fsys_t)
-#define FSYS_DESTRUCTOR trivfs_end_using_control (trivfs_control_t)
-
-#define FILE_IMPORTS import <hurd/trivfs.h>;
-#define IO_IMPORTS import <hurd/trivfs.h>;
-#define FSYS_IMPORTS import <hurd/trivfs.h>;
diff --git a/libtrivfs/mig-decls.h b/libtrivfs/mig-decls.h
new file mode 100644
index 0000000..1bbca4e
--- /dev/null
+++ b/libtrivfs/mig-decls.h
@@ -0,0 +1,105 @@
+/* 
+   Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __MIG_DECLS_H__
+#define __MIG_DECLS_H__
+
+#include "priv.h"
+
+/* Vectors of dynamically allocated port classes/buckets.  */
+
+/* Protid port classes.  */
+extern struct port_class **trivfs_dynamic_protid_port_classes;
+extern size_t trivfs_num_dynamic_protid_port_classes;
+
+/* Control port classes.  */
+extern struct port_class **trivfs_dynamic_control_port_classes;
+extern size_t trivfs_num_dynamic_control_port_classes;
+
+/* Port buckets.  */
+extern struct port_bucket **trivfs_dynamic_port_buckets;
+extern size_t trivfs_num_dynamic_port_buckets;
+
+static inline struct trivfs_protid * __attribute__ ((unused))
+trivfs_begin_using_protid (mach_port_t port)
+{
+  if (trivfs_protid_nportclasses + trivfs_num_dynamic_protid_port_classes > 1)
+    {
+      struct port_info *pi = ports_lookup_port (0, port, 0);
+      int i;
+
+      if (pi)
+	{
+	  for (i = 0; i < trivfs_protid_nportclasses; i++)
+	    if (pi->class == trivfs_protid_portclasses[i])
+	      return (struct trivfs_protid *) pi;
+	  for (i = 0; i < trivfs_num_dynamic_protid_port_classes; i++)
+	    if (pi->class == trivfs_dynamic_protid_port_classes[i])
+	      return (struct trivfs_protid *) pi;
+	  ports_port_deref (pi);
+	}
+
+      return 0;
+    }
+  else if (trivfs_protid_nportclasses == 1)
+    return ports_lookup_port (0, port, trivfs_protid_portclasses[0]);
+  else
+    return ports_lookup_port (0, port, trivfs_dynamic_protid_port_classes[0]);
+}
+
+static inline void __attribute__ ((unused))
+trivfs_end_using_protid (struct trivfs_protid *cred)
+{
+  if (cred)
+    ports_port_deref (cred);
+}
+
+static inline struct trivfs_control * __attribute__ ((unused))
+trivfs_begin_using_control (mach_port_t port)
+{
+  if (trivfs_cntl_nportclasses + trivfs_num_dynamic_control_port_classes > 1)
+    {
+      struct port_info *pi = ports_lookup_port (0, port, 0);
+      int i;
+
+      if (pi)
+	{
+	  for (i = 0; i < trivfs_cntl_nportclasses; i++)
+	    if (pi->class == trivfs_cntl_portclasses[i])
+	      return (struct trivfs_control *) pi;
+	  for (i = 0; i < trivfs_num_dynamic_control_port_classes; i++)
+	    if (pi->class == trivfs_dynamic_control_port_classes[i])
+	      return (struct trivfs_control *) pi;
+	  ports_port_deref (pi);
+	}
+
+      return 0;
+    }
+  else if (trivfs_cntl_nportclasses == 1)
+    return ports_lookup_port (0, port, trivfs_cntl_portclasses[0]);
+  else
+    return ports_lookup_port (0, port, trivfs_dynamic_control_port_classes[0]);
+}
+
+static inline void __attribute__ ((unused))
+trivfs_end_using_control (struct trivfs_control *cred)
+{
+  if (cred)
+    ports_port_deref (cred);
+}
+
+#endif /* __MIG_DECLS_H__ */
diff --git a/libtrivfs/mig-mutate.h b/libtrivfs/mig-mutate.h
new file mode 100644
index 0000000..fad5389
--- /dev/null
+++ b/libtrivfs/mig-mutate.h
@@ -0,0 +1,32 @@
+/*
+   Copyright (C) 1994,95,2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* Only CPP macro definitions should go in this file. */
+
+#define REPLY_PORTS
+
+#define FILE_INTRAN trivfs_protid_t trivfs_begin_using_protid (file_t)
+#define FILE_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
+#define FILE_IMPORTS import "mig-decls.h";
+
+#define IO_INTRAN trivfs_protid_t trivfs_begin_using_protid (io_t)
+#define IO_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
+#define IO_IMPORTS import "mig-decls.h";
+
+#define FSYS_INTRAN trivfs_control_t trivfs_begin_using_control (fsys_t)
+#define FSYS_DESTRUCTOR trivfs_end_using_control (trivfs_control_t)
+#define FSYS_IMPORTS import "mig-decls.h";
diff --git a/libtrivfs/migsupport.c b/libtrivfs/migsupport.c
deleted file mode 100644
index b2d98e1..0000000
--- a/libtrivfs/migsupport.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* 
-   Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include "priv.h"
-
-struct trivfs_protid *
-trivfs_begin_using_protid (mach_port_t port)
-{
-  if (trivfs_protid_nportclasses + trivfs_num_dynamic_protid_port_classes > 1)
-    {
-      struct port_info *pi = ports_lookup_port (0, port, 0);
-      int i;
-
-      if (pi)
-	{
-	  for (i = 0; i < trivfs_protid_nportclasses; i++)
-	    if (pi->class == trivfs_protid_portclasses[i])
-	      return (struct trivfs_protid *) pi;
-	  for (i = 0; i < trivfs_num_dynamic_protid_port_classes; i++)
-	    if (pi->class == trivfs_dynamic_protid_port_classes[i])
-	      return (struct trivfs_protid *) pi;
-	  ports_port_deref (pi);
-	}
-      
-      return 0;
-    }
-  else if (trivfs_protid_nportclasses == 1)
-    return ports_lookup_port (0, port, trivfs_protid_portclasses[0]);
-  else
-    return ports_lookup_port (0, port, trivfs_dynamic_protid_port_classes[0]);
-}
-
-void 
-trivfs_end_using_protid (struct trivfs_protid *cred)
-{
-  if (cred)
-    ports_port_deref (cred);
-}
-
-struct trivfs_control *
-trivfs_begin_using_control (mach_port_t port)
-{
-  if (trivfs_cntl_nportclasses + trivfs_num_dynamic_control_port_classes > 1)
-    {
-      struct port_info *pi = ports_lookup_port (0, port, 0);
-      int i;
-
-      if (pi)
-	{
-	  for (i = 0; i < trivfs_cntl_nportclasses; i++)
-	    if (pi->class == trivfs_cntl_portclasses[i])
-	      return (struct trivfs_control *) pi;
-	  for (i = 0; i < trivfs_num_dynamic_control_port_classes; i++)
-	    if (pi->class == trivfs_dynamic_control_port_classes[i])
-	      return (struct trivfs_control *) pi;
-	  ports_port_deref (pi);
-	}
-      
-      return 0;
-    }
-  else if (trivfs_cntl_nportclasses == 1)
-    return ports_lookup_port (0, port, trivfs_cntl_portclasses[0]);
-  else
-    return ports_lookup_port (0, port, trivfs_dynamic_control_port_classes[0]);
-}
-
-void 
-trivfs_end_using_control (struct trivfs_control *cred)
-{
-  if (cred)
-    ports_port_deref (cred);
-}
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index cf817b5..e2a48b4 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -37,11 +37,6 @@ struct trivfs_protid
   struct trivfs_peropen *po;
 };
 
-/* These can be used as `intran' and `destructor' functions for
-   a MiG port type, to have the stubs called with the protid pointer.  */
-struct trivfs_protid *trivfs_begin_using_protid (mach_port_t);
-void trivfs_end_using_protid (struct trivfs_protid *);
-
 struct trivfs_peropen
 {
   void *hook;			/* for user use */
@@ -62,11 +57,6 @@ struct trivfs_control
   void *hook;			/* for user use */
 };
 
-/* These can be used as `intran' and `destructor' functions for
-   a MiG port type, to have the stubs called with the control pointer.  */
-struct trivfs_control *trivfs_begin_using_control (mach_port_t);
-void trivfs_end_using_control (struct trivfs_control *);
-
 
 /* The user must define these variables. */
 extern int trivfs_fstype;
@@ -266,41 +256,9 @@ error_t trivfs_add_port_bucket (struct port_bucket **bucket);
 /* Remove the previously added dynamic port bucket BUCKET, freeing it
    if it was allocated by trivfs_add_port_bucket.  */
 void trivfs_remove_port_bucket (struct port_bucket *bucket);
-
 
-/* This stuff is for the sake of MiG stubs and could be in a private
-   header.  But it might be handy for users that override parts of the
-   library.  Moreover, since the stub headers will use all the imports we
-   need for the stubs, we couldn't make the stub headers public without
-   making this public too.  */
-
+/* Type-aliases for mig.  */
 typedef struct trivfs_protid *trivfs_protid_t;
 typedef struct trivfs_control *trivfs_control_t;
 
-struct trivfs_protid *_trivfs_begin_using_protid (mach_port_t);
-void _trivfs_end_using_protid (struct trivfs_protid *);
-struct trivfs_control *_trivfs_begin_using_control (mach_port_t);
-void _trivfs_end_using_control (struct trivfs_control *);
-
-/* Vectors of dynamically allocated port classes/buckets.  */
-
-/* Protid port classes.  */
-extern struct port_class **trivfs_dynamic_protid_port_classes;
-extern size_t trivfs_num_dynamic_protid_port_classes;
-
-/* Control port classes.  */
-extern struct port_class **trivfs_dynamic_control_port_classes;
-extern size_t trivfs_num_dynamic_control_port_classes;
-
-/* Port buckets.  */
-extern struct port_bucket **trivfs_dynamic_port_buckets;
-extern size_t trivfs_num_dynamic_port_buckets;
-
-/* These are the MiG-generated headers that declare prototypes
-   for the server functions.  */
-#include <hurd/trivfs_fs_S.h>
-#include <hurd/trivfs_io_S.h>
-#include <hurd/trivfs_fsys_S.h>
-
-
 #endif /* __TRIVFS_H__ */
diff --git a/pfinet/Makefile b/pfinet/Makefile
index d442629..9bda137 100644
--- a/pfinet/Makefile
+++ b/pfinet/Makefile
@@ -139,9 +139,9 @@ asm/checksum.h: ../config.status
 	     '#include "../linux-src/include/asm-$(asm_syntax)/checksum.h"'
 	mv -f $@.new $@
 
-io-MIGSFLAGS = -imacros $(srcdir)/mutations.h
-socket-MIGSFLAGS = -imacros $(srcdir)/mutations.h
+io-MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
+socket-MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
 
 # cpp doesn't automatically make dependencies for -imacros dependencies. argh.
-io_S.h ioServer.c socket_S.h socketServer.c: mutations.h
+io_S.h ioServer.c socket_S.h socketServer.c: mig-mutate.h
 $(OBJS): config.h
diff --git a/pfinet/iioctl-ops.c b/pfinet/iioctl-ops.c
index 6777680..bd876ee 100644
--- a/pfinet/iioctl-ops.c
+++ b/pfinet/iioctl-ops.c
@@ -36,6 +36,8 @@
 #include <net/if.h>
 #include <net/sock.h>
 
+#include "mig-decls.h"
+
 extern struct notifier_block *netdev_chain;
 
 /* devinet.c */
diff --git a/pfinet/mig-decls.h b/pfinet/mig-decls.h
new file mode 100644
index 0000000..2898991
--- /dev/null
+++ b/pfinet/mig-decls.h
@@ -0,0 +1,55 @@
+/*
+   Copyright (C) 1995,96,2000 Free Software Foundation, Inc.
+   Written by Michael I. Bushnell, p/BSG.
+
+   This file is part of the GNU Hurd.
+
+   The GNU Hurd is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   The GNU Hurd is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with the GNU Hurd.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef __MIG_DECLS_H__
+#define __MIG_DECLS_H__
+
+#include "pfinet.h"
+
+/* MiG bogosity */
+typedef struct sock_user *sock_user_t;
+typedef struct sock_addr *sock_addr_t;
+
+static inline struct sock_user * __attribute__ ((unused))
+begin_using_socket_port (mach_port_t port)
+{
+  return ports_lookup_port (pfinet_bucket, port, socketport_class);
+}
+
+static inline void __attribute__ ((unused))
+end_using_socket_port (struct sock_user *user)
+{
+  if (user)
+    ports_port_deref (user);
+}
+
+static inline struct sock_addr * __attribute__ ((unused))
+begin_using_sockaddr_port (mach_port_t port)
+{
+  return ports_lookup_port (pfinet_bucket, port, addrport_class);
+}
+
+static inline void __attribute__ ((unused))
+end_using_sockaddr_port (struct sock_addr *addr)
+{
+  if (addr)
+    ports_port_deref (addr);
+}
+
+#endif /* __MIG_DECLS_H__ */
diff --git a/pfinet/mig-mutate.h b/pfinet/mig-mutate.h
new file mode 100644
index 0000000..4d97408
--- /dev/null
+++ b/pfinet/mig-mutate.h
@@ -0,0 +1,37 @@
+/*
+   Copyright (C) 1995 Free Software Foundation, Inc.
+   Written by Michael I. Bushnell, p/BSG.
+
+   This file is part of the GNU Hurd.
+
+   The GNU Hurd is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2, or (at
+   your option) any later version.
+
+   The GNU Hurd is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
+
+/* Only CPP macro definitions should go in this file. */
+
+#define IO_SELECT_REPLY_PORT
+
+#define IO_INTRAN sock_user_t begin_using_socket_port (io_t)
+#define IO_DESTRUCTOR end_using_socket_port (sock_user_t)
+#define IO_IMPORTS import "mig-decls.h";
+
+#define SOCKET_INTRAN sock_user_t begin_using_socket_port (socket_t)
+#define SOCKET_DESTRUCTOR end_using_socket_port (sock_user_t)
+#define SOCKET_IMPORTS import "mig-decls.h";
+
+#define ADDRPORT_INTRAN sock_addr_t begin_using_sockaddr_port (addr_port_t)
+#define ADDRPORT_DESTRUCTOR end_using_sockaddr_port (sock_addr_t)
+
+#define PF_INTRAN trivfs_protid_t trivfs_begin_using_protid (pf_t)
+#define PF_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
diff --git a/pfinet/misc.c b/pfinet/misc.c
index 08b19e9..d0987eb 100644
--- a/pfinet/misc.c
+++ b/pfinet/misc.c
@@ -62,32 +62,6 @@ make_sockaddr_port (struct socket *sock,
   return 0;
 }
 
-struct sock_user *
-begin_using_socket_port (mach_port_t port)
-{
-  return ports_lookup_port (pfinet_bucket, port, socketport_class);
-}
-
-void
-end_using_socket_port (struct sock_user *user)
-{
-  if (user)
-    ports_port_deref (user);
-}
-
-struct sock_addr *
-begin_using_sockaddr_port (mach_port_t port)
-{
-  return ports_lookup_port (pfinet_bucket, port, addrport_class);
-}
-
-void
-end_using_sockaddr_port (struct sock_addr *addr)
-{
-  if (addr)
-    ports_port_deref (addr);
-}
-
 /* Nothing need be done here. */
 void
 clean_addrport (void *arg)
diff --git a/pfinet/mutations.h b/pfinet/mutations.h
deleted file mode 100644
index f63ad9b..0000000
--- a/pfinet/mutations.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
-   Copyright (C) 1995 Free Software Foundation, Inc.
-   Written by Michael I. Bushnell, p/BSG.
-
-   This file is part of the GNU Hurd.
-
-   The GNU Hurd is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License as
-   published by the Free Software Foundation; either version 2, or (at
-   your option) any later version.
-
-   The GNU Hurd is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
-
-/* Only CPP macro definitions should go in this file. */
-
-#define IO_SELECT_REPLY_PORT
-
-#define IO_INTRAN sock_user_t begin_using_socket_port (io_t)
-#define IO_DESTRUCTOR end_using_socket_port (sock_user_t)
-
-#define SOCKET_INTRAN sock_user_t begin_using_socket_port (socket_t)
-#define SOCKET_DESTRUCTOR end_using_socket_port (sock_user_t)
-
-#define ADDRPORT_INTRAN sock_addr_t begin_using_sockaddr_port (addr_port_t)
-#define ADDRPORT_DESTRUCTOR end_using_sockaddr_port (sock_addr_t)
-
-#define PF_INTRAN trivfs_protid_t trivfs_begin_using_protid (pf_t)
-#define PF_DESTRUCTOR trivfs_end_using_protid (trivfs_protid_t)
-
-#define IO_IMPORTS import "pfinet.h";
-#define SOCKET_IMPORTS import "pfinet.h";
diff --git a/pfinet/pfinet.h b/pfinet/pfinet.h
index 9725dab..46aa97b 100644
--- a/pfinet/pfinet.h
+++ b/pfinet/pfinet.h
@@ -83,18 +83,9 @@ void ip_rt_del (u_long, struct device *);
 struct sock;
 error_t tcp_tiocinq (struct sock *sk, mach_msg_type_number_t *amount);
 
-
-struct sock_user *begin_using_socket_port (socket_t);
-struct sock_addr *begin_using_sockaddr_port (socket_t);
-void end_using_socket_port (struct sock_user *);
-void end_using_sockaddr_port (struct sock_addr *);
 void clean_addrport (void *);
 void clean_socketport (void *);
 
-/* MiG bogosity */
-typedef struct sock_user *sock_user_t;
-typedef struct sock_addr *sock_addr_t;
-
 /* pfinet6 port classes. */
 enum {
   PORTCLASS_INET,