From: Christopher Faulet Date: Mon, 18 Sep 2017 09:54:51 +0000 (+0200) Subject: MINOR: action: Add trk_idx inline function X-Git-Tag: v1.8-rc1~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7421b14c220e6639ec67b3ff372962c9537602b5;p=thirdparty%2Fhaproxy.git MINOR: action: Add trk_idx inline function It returns tracking index corresponding to an action ACT_ACTION_TRK_SC*. It will replace http_trk_idx and tcp_trk_idx. --- diff --git a/include/proto/action.h b/include/proto/action.h index fea40cf235..ce94aa0496 100644 --- a/include/proto/action.h +++ b/include/proto/action.h @@ -68,4 +68,12 @@ static inline void action_build_list(struct list *keywords, struct chunk *chk) *p = '\0'; } +/* for an action ACT_ACTION_TRK_SC*, return a tracking index starting at zero + * for SC0. Unknown actions also return zero. + */ +static inline int trk_idx(int trk_action) +{ + return trk_action - ACT_ACTION_TRK_SC0; +} + #endif /* _PROTO_ACTION_H */