File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ module Make (R : Mirage_random.S) (Mclock : Mirage_clock.MCLOCK) (Time : Mirage_
33
33
let _, (dst, dst_port) = Utcp. peers flow in
34
34
dst, dst_port
35
35
36
+ let src (_t , flow ) =
37
+ let (src, src_port), _ = Utcp. peers flow in
38
+ src, src_port
39
+
36
40
let output_ip t (src , dst , seg ) =
37
41
let size = Utcp.Segment. length seg in
38
42
Log. debug (fun m -> m " output to %a: %a" Ipaddr. pp dst Utcp.Segment. pp seg);
@@ -122,6 +126,15 @@ module Make (R : Mirage_random.S) (Mclock : Mirage_clock.MCLOCK) (Time : Mirage_
122
126
Log. err (fun m -> m " %a error in close: %s" Utcp. pp_flow flow msg);
123
127
Lwt. return_unit
124
128
129
+ let shutdown (t , flow ) mode =
130
+ match Utcp. shutdown t.tcp (now () ) flow mode with
131
+ | Ok (tcp , segs ) ->
132
+ t.tcp < - tcp ;
133
+ output_ign t segs
134
+ | Error `Msg msg ->
135
+ Log. err (fun m -> m " %a error in shutdown: %s" Utcp. pp_flow flow msg);
136
+ Lwt. return_unit
137
+
125
138
let write_nodelay flow buf = write flow buf
126
139
127
140
let writev_nodelay flow bufs = write flow (Cstruct. concat bufs)
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ depends: [
23
23
"mirage-random" {>= "2.0.0"}
24
24
"mirage-time" {>= "2.0.1"}
25
25
"mirage-clock" {>= "3.1.0"}
26
- "tcpip" {>= "7.0.0"}
26
+ "tcpip" {>= "8.0.1"}
27
+ "mirage-flow" {>= "4.0.0"}
27
28
#for apps
28
29
"cmdliner" {>= "1.1.0" & dev}
29
30
"mirage-net-unix" {>= "2.8.0" & dev}
You can’t perform that action at this time.
0 commit comments