]> git.proxmox.com Git - qemu.git/blobdiff - slirp/udp.h
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
[qemu.git] / slirp / udp.h
index 67da6cd731b0219a884c338541d6f549169bd285..9bf31fe7be41a7ad631b84b0db1a0c56d2054313 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
 #define UDP_TTL 0x60
 #define UDP_UDPDATALEN 16192
 
-extern struct socket *udp_last_so;
-
 /*
  * Udp protocol header.
  * Per RFC 768, September, 1981.
  */
 struct udphdr {
-       u_int16_t       uh_sport;               /* source port */
-       u_int16_t       uh_dport;               /* destination port */
-       int16_t uh_ulen;                /* udp length */
-       u_int16_t       uh_sum;                 /* udp checksum */
+    uint16_t uh_sport;          /* source port */
+    uint16_t uh_dport;          /* destination port */
+    int16_t  uh_ulen;           /* udp length */
+    uint16_t uh_sum;            /* udp checksum */
 };
 
 /*
@@ -60,8 +54,7 @@ struct udpiphdr {
                struct  ipovly ui_i;            /* overlaid ip structure */
                struct  udphdr ui_u;            /* udp header */
 };
-#define ui_next         ui_i.ih_next
-#define ui_prev         ui_i.ih_prev
+#define ui_mbuf         ui_i.ih_mbuf.mptr
 #define ui_x1           ui_i.ih_x1
 #define ui_pr           ui_i.ih_pr
 #define ui_len          ui_i.ih_len
@@ -72,38 +65,22 @@ struct udpiphdr {
 #define ui_ulen         ui_u.uh_ulen
 #define ui_sum          ui_u.uh_sum
 
-struct udpstat {
-                                       /* input statistics: */
-               u_long  udps_ipackets;          /* total input packets */
-               u_long  udps_hdrops;            /* packet shorter than header */
-               u_long  udps_badsum;            /* checksum error */
-               u_long  udps_badlen;            /* data length larger than packet */
-               u_long  udps_noport;            /* no socket on port */
-               u_long  udps_noportbcast;       /* of above, arrived as broadcast */
-               u_long  udps_fullsock;          /* not delivered, input socket full */
-               u_long  udpps_pcbcachemiss;     /* input packets missing pcb cache */
-                                       /* output statistics: */
-               u_long  udps_opackets;          /* total output packets */
-};
-
 /*
  * Names for UDP sysctl objects
  */
 #define UDPCTL_CHECKSUM         1       /* checksum UDP packets */
 #define UDPCTL_MAXID            2
 
-extern struct udpstat udpstat;
-extern struct socket udb;
 struct mbuf;
 
-void udp_init _P((void));
-void udp_input _P((register struct mbuf *, int));
-int udp_output _P((struct socket *, struct mbuf *, struct sockaddr_in *));
-int udp_attach _P((struct socket *));
-void udp_detach _P((struct socket *));
-u_int8_t udp_tos _P((struct socket *));
-void udp_emu _P((struct socket *, struct mbuf *));
-struct socket * udp_listen _P((u_int, u_int32_t, u_int, int));
+void udp_init(Slirp *);
+void udp_cleanup(Slirp *);
+void udp_input(register struct mbuf *, int);
+int udp_output(struct socket *, struct mbuf *, struct sockaddr_in *);
+int udp_attach(struct socket *);
+void udp_detach(struct socket *);
+struct socket * udp_listen(Slirp *, uint32_t, u_int, uint32_t, u_int,
+                           int);
 int udp_output2(struct socket *so, struct mbuf *m,
                 struct sockaddr_in *saddr, struct sockaddr_in *daddr,
                 int iptos);