NewMadeleine

Documentation

« back to PM2 home.
nm_strategy.h
Go to the documentation of this file.
1/*
2 * NewMadeleine
3 * Copyright (C) 2006-2025 (see AUTHORS file)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 */
15
16#ifndef NM_STRATEGY_H
17#define NM_STRATEGY_H
18
22{
29
31 void (*init)(puk_context_t p_context);
32
34 void (*close)(puk_context_t p_context);
35
37 nm_drv_vect_t (*connect)(void*_status, nm_gate_t p_gate, nm_drv_vect_t p_available_drvs);
38
43 void (*schedule)(puk_context_t p_context);
44
47 void (*try_and_commit)(void*_status, nm_gate_t p_gate);
48
50 void (*rdv_accept)(void*_status, nm_gate_t p_gate);
51
53 void (*proto)(void*_status, nm_gate_t p_gate, struct nm_pkt_wrap_s*p_pw, const void*ptr, nm_len_t len);
54
56 void (*pw_send_post)(void*_status, struct nm_pkt_wrap_s*p_pw);
57
59 void (*pw_send_complete)(void*_status, struct nm_pkt_wrap_s*p_pw);
60
62 void (*pw_recv_complete)(void*_status, struct nm_pkt_wrap_s*p_pw);
63
64};
65
66PUK_IFACE_TYPE(NewMad_Strategy, struct nm_strategy_iface_s);
67
68#endif /* NM_STRATEGY_H */
static nm_gate_t p_gate
uint16_t len
chunk len
Definition nm_headers.h:0
PUK_IFACE_TYPE(NewMad_Strategy, struct nm_strategy_iface_s)
uint64_t nm_len_t
data length used by nmad
Definition nm_types.h:68
Connection to another process.
Definition nm_gate.h:104
Internal packet wrapper.
strategy capabilities, not supposed to be used by nmad core, but may be usefull for the user to check...
Definition nm_strategy.h:26
int supports_priorities
whether the strategy supports priority-based scheduling
Definition nm_strategy.h:27
Driver for 'NewMad_Strategy' component interface.
Definition nm_strategy.h:22
void(* pw_send_complete)(void *_status, struct nm_pkt_wrap_s *p_pw)
notify send completion for pw
Definition nm_strategy.h:59
void(* rdv_accept)(void *_status, nm_gate_t p_gate)
Emit RTR series for received RDV requests.
Definition nm_strategy.h:50
nm_drv_vect_t(* connect)(void *_status, nm_gate_t p_gate, nm_drv_vect_t p_available_drvs)
selects the drivers to actually use, among the list of available drivers for the given gate
Definition nm_strategy.h:37
void(* try_and_commit)(void *_status, nm_gate_t p_gate)
Compute and apply the best possible packet rearrangement, then return next packet to send.
Definition nm_strategy.h:47
void(* proto)(void *_status, nm_gate_t p_gate, struct nm_pkt_wrap_s *p_pw, const void *ptr, nm_len_t len)
process strat private protocol
Definition nm_strategy.h:53
void(* close)(puk_context_t p_context)
close the strategy context
Definition nm_strategy.h:34
void(* pw_send_post)(void *_status, struct nm_pkt_wrap_s *p_pw)
schedule the given pw for sending
Definition nm_strategy.h:56
void(* pw_recv_complete)(void *_status, struct nm_pkt_wrap_s *p_pw)
notify recv completion for pw
Definition nm_strategy.h:62
void(* init)(puk_context_t p_context)
init the strategy context (shared across instances)
Definition nm_strategy.h:31
struct nm_strategy_iface_s::nm_strategy_capabilities_s capabilities
void(* schedule)(puk_context_t p_context)
schedule all events:
Definition nm_strategy.h:43