1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// Key and value names of the location of the RLZ shared state.
6
7#ifndef RLZ_LIB_LIB_VALUES_H_
8#define RLZ_LIB_LIB_VALUES_H_
9
10#include "base/basictypes.h"
11#include "rlz/lib/rlz_enums.h"
12
13namespace rlz_lib {
14
15//
16// Ping CGI arguments:
17//
18//   Events are reported as (without spaces):
19//   kEventsCgiVariable = <AccessPoint1><Event1> kEventsCgiSeparator <P2><E2>...
20//
21//   Event responses from the server look like:
22//   kEventsCgiVariable : <AccessPoint1><Event1> kEventsCgiSeparator <P2><E2>...
23//
24//   RLZ's are reported as (without spaces):
25//   kRlzCgiVariable = <AccessPoint> <kRlzCgiIndicator> <RLZ value>
26//        <kRlzCgiSeparator> <AP2><Indicator><V2><Separator> ....
27//
28//   RLZ responses from the server look like (without spaces):
29//   kRlzCgiVariable<Access Point> :  <RLZ value>
30//
31//   DCC if reported should look like (without spaces):
32//   kDccCgiVariable = <DCC Value>
33//
34//   RLS if reported should look like (without spaces):
35//   kRlsCgiVariable = <RLS Value>
36//
37//   Machine ID if reported should look like (without spaces):
38//   kMachineIdCgiVariable = <Machine ID Value>
39//
40//   A server response setting / confirming the DCC will look like (no spaces):
41//   kDccCgiVariable : <DCC Value>
42//
43//   Each ping to the server must also contain kProtocolCgiArgument as well.
44//
45//   Pings may also contain (but not necessarily controlled by this Lib):
46//   - The product signature: kProductSignatureCgiVariable = <signature>
47//   - The product brand: kProductBrandCgiVariable = <brand>
48//   - The product installation ID: kProductIdCgiVariable = <id>
49extern const char kEventsCgiVariable[];
50extern const char kStatefulEventsCgiVariable[];
51extern const char kEventsCgiSeparator;
52
53extern const char kDccCgiVariable[];
54extern const char kProtocolCgiArgument[];
55
56extern const char kProductSignatureCgiVariable[];
57extern const char kProductBrandCgiVariable[];
58extern const char kProductLanguageCgiVariable[];
59extern const char kProductIdCgiVariable[];
60
61extern const char kRlzCgiVariable[];
62extern const char kRlzCgiSeparator[];
63extern const char kRlzCgiIndicator[];
64
65extern const char kRlsCgiVariable[];
66extern const char kMachineIdCgiVariable[];
67extern const char kSetDccResponseVariable[];
68
69//
70// Financial ping server information.
71//
72
73extern const char kFinancialPingPath[];
74extern const char kFinancialServer[];
75
76extern const int kFinancialPort;
77
78extern const int64 kEventsPingInterval;
79extern const int64 kNoEventsPingInterval;
80
81extern const char kFinancialPingUserAgent[];
82extern const char* kFinancialPingResponseObjects[];
83
84//
85// The names for AccessPoints and Events that we use MUST be the same
86// as those used/understood by the server.
87//
88const char* GetAccessPointName(AccessPoint point);
89bool GetAccessPointFromName(const char* name, AccessPoint* point);
90
91const char* GetEventName(Event event);
92bool GetEventFromName(const char* name, Event* event);
93
94// The names for products are used only client-side.
95const char* GetProductName(Product product);
96
97}  // namespace rlz_lib
98
99#endif  // RLZ_LIB_LIB_VALUES_H_
100