mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-01 22:48:25 +00:00
MINOR: hlua: Rename set_{tos, mark} to set_fc_{tos, mark}
This is a complementary patch to "MINOR: tcp-act: Rename "set-{mark,tos}" to "set-fc-{mark,tos}"", but for the Lua API. set_mark and set_tos were kept as aliases for set_fc_mark and set_fc_tos but they were marked as deprecated. Using this opportunity to reorder set_mark and set_tos by alphabetical order.
This commit is contained in:
parent
acf6383076
commit
03cb782bcb
@ -2870,6 +2870,22 @@ TXN class
|
||||
|
||||
:see: :js:func:`TXN.reply`, :js:class:`Reply`
|
||||
|
||||
.. js:function:: TXN.set_fc_tos(txn, tos)
|
||||
|
||||
Is used to set the TOS or DSCP field value of packets sent to the client to
|
||||
the value passed in "tos" on platforms which support this.
|
||||
|
||||
:param class_txn txn: The class txn object containing the data.
|
||||
:param integer tos: The new TOS os DSCP.
|
||||
|
||||
.. js:function:: TXN.set_fc_mark(txn, mark)
|
||||
|
||||
Is used to set the Netfilter MARK on all packets sent to the client to the
|
||||
value passed in "mark" on platforms which support it.
|
||||
|
||||
:param class_txn txn: The class txn object containing the data.
|
||||
:param integer mark: The mark value.
|
||||
|
||||
.. js:function:: TXN.set_loglevel(txn, loglevel)
|
||||
|
||||
Is used to change the log level of the current request. The "loglevel" must
|
||||
@ -2881,21 +2897,21 @@ TXN class
|
||||
:js:attr:`core.err`, :js:attr:`core.warning`, :js:attr:`core.notice`,
|
||||
:js:attr:`core.info`, :js:attr:`core.debug` (log level definitions)
|
||||
|
||||
.. js:function:: TXN.set_tos(txn, tos)
|
||||
|
||||
Is used to set the TOS or DSCP field value of packets sent to the client to
|
||||
the value passed in "tos" on platforms which support this.
|
||||
|
||||
:param class_txn txn: The class txn object containing the data.
|
||||
:param integer tos: The new TOS os DSCP.
|
||||
|
||||
.. js:function:: TXN.set_mark(txn, mark)
|
||||
|
||||
Is used to set the Netfilter MARK on all packets sent to the client to the
|
||||
value passed in "mark" on platforms which support it.
|
||||
Alias for :js:func:`TXN.set_fc_mark()`.
|
||||
|
||||
:param class_txn txn: The class txn object containing the data.
|
||||
:param integer mark: The mark value.
|
||||
.. warning::
|
||||
This function is deprecated. :js:func:`TXN.set_fc_mark()` must be used
|
||||
instead.
|
||||
|
||||
.. js:function:: TXN.set_tos(txn, tos)
|
||||
|
||||
Alias for :js:func:`TXN.set_fc_tos()`.
|
||||
|
||||
.. warning::
|
||||
This function is deprecated. :js:func:`TXN.set_fc_tos()` must be used
|
||||
instead.
|
||||
|
||||
.. js:function:: TXN.set_priority_class(txn, prio)
|
||||
|
||||
|
58
src/hlua.c
58
src/hlua.c
@ -8192,6 +8192,32 @@ __LJMP static int hlua_txn_log_alert(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
__LJMP static int hlua_txn_set_fc_mark(lua_State *L)
|
||||
{
|
||||
struct hlua_txn *htxn;
|
||||
int mark;
|
||||
|
||||
MAY_LJMP(check_args(L, 2, "set_fc_mark"));
|
||||
htxn = MAY_LJMP(hlua_checktxn(L, 1));
|
||||
mark = MAY_LJMP(luaL_checkinteger(L, 2));
|
||||
|
||||
conn_set_mark(objt_conn(htxn->s->sess->origin), mark);
|
||||
return 0;
|
||||
}
|
||||
|
||||
__LJMP static int hlua_txn_set_fc_tos(lua_State *L)
|
||||
{
|
||||
struct hlua_txn *htxn;
|
||||
int tos;
|
||||
|
||||
MAY_LJMP(check_args(L, 2, "set_fc_tos"));
|
||||
htxn = MAY_LJMP(hlua_checktxn(L, 1));
|
||||
tos = MAY_LJMP(luaL_checkinteger(L, 2));
|
||||
|
||||
conn_set_tos(objt_conn(htxn->s->sess->origin), tos);
|
||||
return 0;
|
||||
}
|
||||
|
||||
__LJMP static int hlua_txn_set_loglevel(lua_State *L)
|
||||
{
|
||||
struct hlua_txn *htxn;
|
||||
@ -8208,32 +8234,6 @@ __LJMP static int hlua_txn_set_loglevel(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
__LJMP static int hlua_txn_set_tos(lua_State *L)
|
||||
{
|
||||
struct hlua_txn *htxn;
|
||||
int tos;
|
||||
|
||||
MAY_LJMP(check_args(L, 2, "set_tos"));
|
||||
htxn = MAY_LJMP(hlua_checktxn(L, 1));
|
||||
tos = MAY_LJMP(luaL_checkinteger(L, 2));
|
||||
|
||||
conn_set_tos(objt_conn(htxn->s->sess->origin), tos);
|
||||
return 0;
|
||||
}
|
||||
|
||||
__LJMP static int hlua_txn_set_mark(lua_State *L)
|
||||
{
|
||||
struct hlua_txn *htxn;
|
||||
int mark;
|
||||
|
||||
MAY_LJMP(check_args(L, 2, "set_mark"));
|
||||
htxn = MAY_LJMP(hlua_checktxn(L, 1));
|
||||
mark = MAY_LJMP(luaL_checkinteger(L, 2));
|
||||
|
||||
conn_set_mark(objt_conn(htxn->s->sess->origin), mark);
|
||||
return 0;
|
||||
}
|
||||
|
||||
__LJMP static int hlua_txn_set_priority_class(lua_State *L)
|
||||
{
|
||||
struct hlua_txn *htxn;
|
||||
@ -13776,9 +13776,11 @@ lua_State *hlua_init_state(int thread_num)
|
||||
hlua_class_function(L, "get_var", hlua_get_var);
|
||||
hlua_class_function(L, "done", hlua_txn_done);
|
||||
hlua_class_function(L, "reply", hlua_txn_reply_new);
|
||||
hlua_class_function(L, "set_fc_mark", hlua_txn_set_fc_mark);
|
||||
hlua_class_function(L, "set_fc_tos", hlua_txn_set_fc_tos);
|
||||
hlua_class_function(L, "set_loglevel", hlua_txn_set_loglevel);
|
||||
hlua_class_function(L, "set_tos", hlua_txn_set_tos);
|
||||
hlua_class_function(L, "set_mark", hlua_txn_set_mark);
|
||||
hlua_class_function(L, "set_mark", hlua_txn_set_fc_mark); // DEPRECATED, use set_fc_mark
|
||||
hlua_class_function(L, "set_tos", hlua_txn_set_fc_tos); // DEPRECATED, use set_fc_tos
|
||||
hlua_class_function(L, "set_priority_class", hlua_txn_set_priority_class);
|
||||
hlua_class_function(L, "set_priority_offset", hlua_txn_set_priority_offset);
|
||||
hlua_class_function(L, "deflog", hlua_txn_deflog);
|
||||
|
Loading…
Reference in New Issue
Block a user