]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: stktable: move the stkctr_* functions from stream to sticktable
authorWilly Tarreau <w@1wt.eu>
Sat, 4 Apr 2015 14:24:42 +0000 (16:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Apr 2015 09:37:30 +0000 (11:37 +0200)
These ones are not stream-specific at all and will be needed outside of
stream, so let's move them to stick_tables where struct stkctr is defined.

include/proto/stick_table.h
include/proto/stream.h

index 11b98dfe99e5446813cc18a393883f80616a188c..de9fd52ead4fe874524b8a323711497d6105eb1d 100644 (file)
@@ -135,4 +135,34 @@ static inline void stksess_kill_if_expired(struct stktable *t, struct stksess *t
                stksess_kill(t, ts);
 }
 
+/* sets the stick counter's entry pointer */
+static inline void stkctr_set_entry(struct stkctr *stkctr, struct stksess *entry)
+{
+       stkctr->entry = caddr_from_ptr(entry, 0);
+}
+
+/* returns the entry pointer from a stick counter */
+static inline struct stksess *stkctr_entry(struct stkctr *stkctr)
+{
+       return caddr_to_ptr(stkctr->entry);
+}
+
+/* returns the two flags from a stick counter */
+static inline unsigned int stkctr_flags(struct stkctr *stkctr)
+{
+       return caddr_to_data(stkctr->entry);
+}
+
+/* sets up to two flags at a time on a composite address */
+static inline void stkctr_set_flags(struct stkctr *stkctr, unsigned int flags)
+{
+       stkctr->entry = caddr_set_flags(stkctr->entry, flags);
+}
+
+/* returns the two flags from a stick counter */
+static inline void stkctr_clr_flags(struct stkctr *stkctr, unsigned int flags)
+{
+       stkctr->entry = caddr_clr_flags(stkctr->entry, flags);
+}
+
 #endif /* _PROTO_STICK_TABLE_H */
index eade0285050d9d2515fc830779d6d00be2d62700..cb166152386211edc7874a0912958fd3b1279fde 100644 (file)
@@ -86,36 +86,6 @@ static inline enum obj_type *strm_orig(const struct stream *strm)
        return strm->sess->origin;
 }
 
-/* sets the stick counter's entry pointer */
-static inline void stkctr_set_entry(struct stkctr *stkctr, struct stksess *entry)
-{
-       stkctr->entry = caddr_from_ptr(entry, 0);
-}
-
-/* returns the entry pointer from a stick counter */
-static inline struct stksess *stkctr_entry(struct stkctr *stkctr)
-{
-       return caddr_to_ptr(stkctr->entry);
-}
-
-/* returns the two flags from a stick counter */
-static inline unsigned int stkctr_flags(struct stkctr *stkctr)
-{
-       return caddr_to_data(stkctr->entry);
-}
-
-/* sets up to two flags at a time on a composite address */
-static inline void stkctr_set_flags(struct stkctr *stkctr, unsigned int flags)
-{
-       stkctr->entry = caddr_set_flags(stkctr->entry, flags);
-}
-
-/* returns the two flags from a stick counter */
-static inline void stkctr_clr_flags(struct stkctr *stkctr, unsigned int flags)
-{
-       stkctr->entry = caddr_clr_flags(stkctr->entry, flags);
-}
-
 /* Remove the refcount from the stream to the tracked counters, and clear the
  * pointer to ensure this is only performed once. The caller is responsible for
  * ensuring that the pointer is valid first.