Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
9e1f7018
Commit
9e1f7018
authored
12 years ago
by
Guy Zana
Browse files
Options
Downloads
Patches
Plain Diff
Ported ip_proto.c
parent
33ce644f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bsd/porting/netport.h
+2
-0
2 additions, 0 deletions
bsd/porting/netport.h
bsd/sys/netinet/in.h
+0
-2
0 additions, 2 deletions
bsd/sys/netinet/in.h
bsd/sys/netinet/in_proto.c
+66
-30
66 additions, 30 deletions
bsd/sys/netinet/in_proto.c
bsd/sys/netinet/ip.h
+1
-1
1 addition, 1 deletion
bsd/sys/netinet/ip.h
with
69 additions
and
33 deletions
bsd/porting/netport.h
+
2
−
0
View file @
9e1f7018
...
...
@@ -6,6 +6,8 @@
#include
<memory.h>
#include
<time.h>
#define FEATURE(...)
#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb)
#define intotw(ip) ((struct tcptw *)(ip)->inp_ppcb)
#define sototcpcb(so) (intotcpcb(sotoinpcb(so)))
...
...
This diff is collapsed.
Click to expand it.
bsd/sys/netinet/in.h
+
0
−
2
View file @
9e1f7018
...
...
@@ -123,10 +123,8 @@ __END_DECLS
#endif
/* !_KERNEL && __BSD_VISIBLE */
#if __POSIX_VISIBLE >= 200112
#define IPPROTO_RAW 255
/* raw IP packet */
#define INET_ADDRSTRLEN 16
#endif
#if __BSD_VISIBLE
/*
...
...
This diff is collapsed.
Click to expand it.
bsd/sys/netinet/in_proto.c
+
66
−
30
View file @
9e1f7018
...
...
@@ -30,25 +30,14 @@
*/
#include
<sys/cdefs.h>
__FBSDID
(
"$FreeBSD$"
);
#include
"opt_ipx.h"
#include
"opt_mrouting.h"
#include
"opt_ipsec.h"
#include
"opt_inet.h"
#include
"opt_inet6.h"
#include
"opt_sctp.h"
#include
"opt_mpath.h"
#include
<bsd/porting/netport.h>
#include
<sys/param.h>
#include
<sys/systm.h>
#include
<sys/kernel.h>
#include
<sys/socket.h>
#include
<sys/domain.h>
#include
<sys/proc.h>
#include
<sys/protosw.h>
#include
<sys/queue.h>
#include
<sys/sysctl.h>
#include
<bsd/sys/sys/param.h>
#include
<bsd/sys/sys/socket.h>
#include
<bsd/sys/sys/domain.h>
#include
<bsd/sys/sys/protosw.h>
#include
<bsd/sys/sys/queue.h>
/*
* While this file provides the domain and protocol switch tables for IPv4, it
...
...
@@ -57,24 +46,26 @@ __FBSDID("$FreeBSD$");
* support compile out everything but these sysctl nodes.
*/
#ifdef INET
#include
<net/if.h>
#include
<net/route.h>
#include
<
bsd/sys/
net/if.h>
#include
<
bsd/sys/
net/route.h>
#ifdef RADIX_MPATH
#include
<net/radix_mpath.h>
#include
<
bsd/sys/
net/radix_mpath.h>
#endif
#include
<net/vnet.h>
#include
<
bsd/sys/
net/vnet.h>
#endif
/* INET */
#if defined(INET) || defined(INET6)
#include
<netinet/in.h>
#include
<
bsd/sys/
netinet/in.h>
#endif
#ifdef INET
#include
<netinet/in_systm.h>
#include
<netinet/in_var.h>
#include
<netinet/ip.h>
#include
<netinet/ip_var.h>
#include
<netinet/ip_icmp.h>
#include
<bsd/sys/netinet/in_systm.h>
#include
<bsd/sys/netinet/in_var.h>
#include
<bsd/sys/netinet/ip.h>
#include
<bsd/sys/netinet/ip_var.h>
#include
<bsd/sys/netinet/ip_icmp.h>
#if 0
#include <netinet/igmp_var.h>
#include <netinet/tcp.h>
#include <netinet/tcp_timer.h>
...
...
@@ -82,6 +73,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/udp.h>
#include <netinet/udp_var.h>
#include <netinet/ip_encap.h>
#endif
/*
* TCP/IP protocol family: IP, ICMP, UDP, TCP.
...
...
@@ -112,6 +104,52 @@ extern struct domain inetdomain;
.pr_usrreqs = &nousrreqs \
}
/* FIXME: OSv: support RAW_IP and ICMP */
struct
protosw
inetsw
[]
=
{
{
.
pr_type
=
SOCK_RAW
,
.
pr_domain
=
&
inetdomain
,
.
pr_protocol
=
IPPROTO_RAW
,
.
pr_flags
=
PR_ATOMIC
|
PR_ADDR
,
.
pr_input
=
rip_input
,
.
pr_ctlinput
=
rip_ctlinput
,
.
pr_ctloutput
=
rip_ctloutput
,
.
pr_usrreqs
=
&
rip_usrreqs
},
{
.
pr_type
=
SOCK_RAW
,
.
pr_domain
=
&
inetdomain
,
.
pr_protocol
=
IPPROTO_ICMP
,
.
pr_flags
=
PR_ATOMIC
|
PR_ADDR
|
PR_LASTHDR
,
.
pr_input
=
icmp_input
,
.
pr_ctloutput
=
rip_ctloutput
,
.
pr_usrreqs
=
&
rip_usrreqs
},
/* Spacer n-times for loadable protocols. */
IPPROTOSPACER
,
IPPROTOSPACER
,
IPPROTOSPACER
,
IPPROTOSPACER
,
IPPROTOSPACER
,
IPPROTOSPACER
,
IPPROTOSPACER
,
IPPROTOSPACER
,
/* raw wildcard */
{
.
pr_type
=
SOCK_RAW
,
.
pr_domain
=
&
inetdomain
,
.
pr_flags
=
PR_ATOMIC
|
PR_ADDR
,
.
pr_input
=
rip_input
,
.
pr_ctloutput
=
rip_ctloutput
,
.
pr_init
=
rip_init
,
#ifdef VIMAGE
.
pr_destroy
=
rip_destroy
,
#endif
.
pr_usrreqs
=
&
rip_usrreqs
},
};
#if 0
struct protosw inetsw[] = {
{
.pr_type = 0,
...
...
@@ -334,6 +372,7 @@ IPPROTOSPACER,
.
pr_usrreqs
=
&
rip_usrreqs
},
}
;
#endif
extern
int
in_inithead
(
void
**
,
int
);
extern
int
in_detachhead
(
void
**
,
int
);
...
...
@@ -367,9 +406,6 @@ SYSCTL_NODE(_net_inet, IPPROTO_IP, ip, CTLFLAG_RW, 0, "IP");
SYSCTL_NODE
(
_net_inet
,
IPPROTO_ICMP
,
icmp
,
CTLFLAG_RW
,
0
,
"ICMP"
);
SYSCTL_NODE
(
_net_inet
,
IPPROTO_UDP
,
udp
,
CTLFLAG_RW
,
0
,
"UDP"
);
SYSCTL_NODE
(
_net_inet
,
IPPROTO_TCP
,
tcp
,
CTLFLAG_RW
,
0
,
"TCP"
);
#ifdef SCTP
SYSCTL_NODE
(
_net_inet
,
IPPROTO_SCTP
,
sctp
,
CTLFLAG_RW
,
0
,
"SCTP"
);
#endif
SYSCTL_NODE
(
_net_inet
,
IPPROTO_IGMP
,
igmp
,
CTLFLAG_RW
,
0
,
"IGMP"
);
#ifdef IPSEC
/* XXX no protocol # to use, pick something "reserved" */
...
...
This diff is collapsed.
Click to expand it.
bsd/sys/netinet/ip.h
+
1
−
1
View file @
9e1f7018
...
...
@@ -67,7 +67,7 @@ struct ip {
u_char
ip_p
;
/* protocol */
u_short
ip_sum
;
/* checksum */
struct
in_addr
ip_src
,
ip_dst
;
/* source and dest address */
}
__
packed
__
aligned
(
4
);
}
__
attribute__
((
aligned
(
4
)
,
packed
))
;
#define IP_MAXPACKET 65535
/* maximum packet size */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment